Package org.mozilla.jss.pkix.primitive
Class SubjectPublicKeyInfo
java.lang.Object
java.security.spec.EncodedKeySpec
java.security.spec.X509EncodedKeySpec
org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo
- All Implemented Interfaces:
Serializable
,Key
,PublicKey
,KeySpec
,ASN1Value
A SubjectPublicKeyInfo, which stores information about a public key.
This class implements
java.security.PublicKey
.- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSubjectPublicKeyInfo
(AlgorithmIdentifier algorithm, BIT_STRING subjectPublicKey) -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag implicit, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.byte[]
getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.Creates a PublicKey from the public key information.Methods inherited from class java.security.spec.X509EncodedKeySpec
getFormat
-
Field Details
-
TAG
-
-
Constructor Details
-
SubjectPublicKeyInfo
-
SubjectPublicKeyInfo
- Throws:
InvalidBERException
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithm
in interfaceKey
- Overrides:
getAlgorithm
in classEncodedKeySpec
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncoded
in interfaceKey
- Overrides:
getEncoded
in classX509EncodedKeySpec
-
getAlgorithmIdentifier
-
getSubjectPublicKey
-
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
implicit
- Implicit tag.ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getTemplate
-
toPublicKey
Creates a PublicKey from the public key information. Currently only RSA and DSA keys can be converted.- Throws:
NoSuchAlgorithmException
- If the cryptographic provider does not recognize the algorithm for this public key.InvalidKeyFormatException
- If the subjectPublicKey could not be decoded correctly.
-