10
10
11
11
import org .bouncycastle .asn1 .ASN1ObjectIdentifier ;
12
12
import org .bouncycastle .asn1 .cryptlib .CryptlibObjectIdentifiers ;
13
+ import org .bouncycastle .asn1 .edec .EdECObjectIdentifiers ;
13
14
import org .bouncycastle .asn1 .gnu .GNUObjectIdentifiers ;
14
15
import org .bouncycastle .asn1 .x9 .ECNamedCurveTable ;
15
16
import org .bouncycastle .asn1 .x9 .X9ECParametersHolder ;
16
17
import org .bouncycastle .bcpg .BCPGKey ;
17
18
import org .bouncycastle .bcpg .BCPGOutputStream ;
18
19
import org .bouncycastle .bcpg .DSAPublicBCPGKey ;
19
20
import org .bouncycastle .bcpg .ECPublicBCPGKey ;
21
+ import org .bouncycastle .bcpg .Ed448PublicBCPGKey ;
20
22
import org .bouncycastle .bcpg .ElGamalPublicBCPGKey ;
23
+ import org .bouncycastle .bcpg .OctetArrayBCPGKey ;
21
24
import org .bouncycastle .bcpg .PublicKeyAlgorithmTags ;
22
25
import org .bouncycastle .bcpg .PublicKeyPacket ;
23
26
import org .bouncycastle .bcpg .PublicSubkeyPacket ;
27
30
import org .bouncycastle .bcpg .UserAttributePacket ;
28
31
import org .bouncycastle .bcpg .UserDataPacket ;
29
32
import org .bouncycastle .bcpg .UserIDPacket ;
33
+ import org .bouncycastle .bcpg .X448PublicBCPGKey ;
30
34
import org .bouncycastle .openpgp .operator .KeyFingerPrintCalculator ;
31
35
import org .bouncycastle .util .Arrays ;
32
36
import org .bouncycastle .util .Pack ;
@@ -98,6 +102,14 @@ else if (key instanceof ECPublicBCPGKey)
98
102
{
99
103
this .keyStrength = 256 ;
100
104
}
105
+ else if (curveOID .equals (EdECObjectIdentifiers .id_X448 ))
106
+ {
107
+ this .keyStrength = X448PublicBCPGKey .LENGTH * 8 ;
108
+ }
109
+ else if (curveOID .equals (EdECObjectIdentifiers .id_Ed448 ))
110
+ {
111
+ this .keyStrength = Ed448PublicBCPGKey .LENGTH * 8 ;
112
+ }
101
113
else
102
114
{
103
115
X9ECParametersHolder ecParameters = ECNamedCurveTable .getByOIDLazy (curveOID );
@@ -112,6 +124,10 @@ else if (key instanceof ECPublicBCPGKey)
112
124
}
113
125
}
114
126
}
127
+ else if (key instanceof OctetArrayBCPGKey )
128
+ {
129
+ this .keyStrength = key .getEncoded ().length * 8 ;
130
+ }
115
131
}
116
132
}
117
133
0 commit comments