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 TypeMethodDescriptionvoidencode(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.voidencode(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:
getAlgorithmin interfaceKey- Overrides:
getAlgorithmin classEncodedKeySpec
-
getEncoded
public byte[] getEncoded()- Specified by:
getEncodedin interfaceKey- Overrides:
getEncodedin classX509EncodedKeySpec
-
getAlgorithmIdentifier
-
getSubjectPublicKey
-
getTag
Description copied from interface:ASN1ValueReturns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using its own base tag.- Specified by:
encodein interfaceASN1Value- Parameters:
ostream- Output stream.- Throws:
IOException- If an error occurred.
-
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using an implicit tag.- Specified by:
encodein 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.
-