Package org.bouncycastle.pqc.crypto.util
Class PublicKeyFactory
java.lang.Object
org.bouncycastle.pqc.crypto.util.PublicKeyFactory
Factory to create asymmetric public key parameters for asymmetric ciphers from range of
ASN.1 encoded SubjectPublicKeyInfo objects.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AsymmetricKeyParameter
createKey
(byte[] keyInfoData) Create a public key from a SubjectPublicKeyInfo encodingstatic AsymmetricKeyParameter
createKey
(InputStream inStr) Create a public key from a SubjectPublicKeyInfo encoding read from a streamstatic AsymmetricKeyParameter
createKey
(SubjectPublicKeyInfo keyInfo) Create a public key from the passed in SubjectPublicKeyInfostatic AsymmetricKeyParameter
createKey
(SubjectPublicKeyInfo keyInfo, Object defaultParams) Create a public key from the passed in SubjectPublicKeyInfo
-
Constructor Details
-
PublicKeyFactory
public PublicKeyFactory()
-
-
Method Details
-
createKey
Create a public key from a SubjectPublicKeyInfo encoding- Parameters:
keyInfoData
- the SubjectPublicKeyInfo encoding- Returns:
- the appropriate key parameter
- Throws:
IOException
- on an error decoding the key
-
createKey
Create a public key from a SubjectPublicKeyInfo encoding read from a stream- Parameters:
inStr
- the stream to read the SubjectPublicKeyInfo encoding from- Returns:
- the appropriate key parameter
- Throws:
IOException
- on an error decoding the key
-
createKey
Create a public key from the passed in SubjectPublicKeyInfo- Parameters:
keyInfo
- the SubjectPublicKeyInfo containing the key data- Returns:
- the appropriate key parameter
- Throws:
IOException
- on an error decoding the key
-
createKey
public static AsymmetricKeyParameter createKey(SubjectPublicKeyInfo keyInfo, Object defaultParams) throws IOException Create a public key from the passed in SubjectPublicKeyInfo- Parameters:
keyInfo
- the SubjectPublicKeyInfo containing the key datadefaultParams
- default parameters that might be needed.- Returns:
- the appropriate key parameter
- Throws:
IOException
- on an error decoding the key
-