1010
1111import org .bouncycastle .asn1 .ASN1ObjectIdentifier ;
1212import org .bouncycastle .asn1 .cryptlib .CryptlibObjectIdentifiers ;
13+ import org .bouncycastle .asn1 .edec .EdECObjectIdentifiers ;
1314import org .bouncycastle .asn1 .gnu .GNUObjectIdentifiers ;
1415import org .bouncycastle .asn1 .x9 .ECNamedCurveTable ;
1516import org .bouncycastle .asn1 .x9 .X9ECParametersHolder ;
1617import org .bouncycastle .bcpg .BCPGKey ;
1718import org .bouncycastle .bcpg .BCPGOutputStream ;
1819import org .bouncycastle .bcpg .DSAPublicBCPGKey ;
1920import org .bouncycastle .bcpg .ECPublicBCPGKey ;
21+ import org .bouncycastle .bcpg .Ed448PublicBCPGKey ;
2022import org .bouncycastle .bcpg .ElGamalPublicBCPGKey ;
23+ import org .bouncycastle .bcpg .OctetArrayBCPGKey ;
2124import org .bouncycastle .bcpg .PublicKeyAlgorithmTags ;
2225import org .bouncycastle .bcpg .PublicKeyPacket ;
2326import org .bouncycastle .bcpg .PublicSubkeyPacket ;
2730import org .bouncycastle .bcpg .UserAttributePacket ;
2831import org .bouncycastle .bcpg .UserDataPacket ;
2932import org .bouncycastle .bcpg .UserIDPacket ;
33+ import org .bouncycastle .bcpg .X448PublicBCPGKey ;
3034import org .bouncycastle .openpgp .operator .KeyFingerPrintCalculator ;
3135import org .bouncycastle .util .Arrays ;
3236import org .bouncycastle .util .Pack ;
@@ -98,6 +102,14 @@ else if (key instanceof ECPublicBCPGKey)
98102 {
99103 this .keyStrength = 256 ;
100104 }
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+ }
101113 else
102114 {
103115 X9ECParametersHolder ecParameters = ECNamedCurveTable .getByOIDLazy (curveOID );
@@ -112,6 +124,10 @@ else if (key instanceof ECPublicBCPGKey)
112124 }
113125 }
114126 }
127+ else if (key instanceof OctetArrayBCPGKey )
128+ {
129+ this .keyStrength = key .getEncoded ().length * 8 ;
130+ }
115131 }
116132 }
117133
0 commit comments