org.mozilla.jss.pkix.primitive
Class SubjectPublicKeyInfo
java.lang.Object
|
+--org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo
- All Implemented Interfaces:
- ASN1Value, java.security.Key, java.security.PublicKey, java.io.Serializable
- public class SubjectPublicKeyInfo
- extends java.lang.Object
- implements ASN1Value, java.security.PublicKey
A SubjectPublicKeyInfo, which stores information about a public key.
This class implements java.security.PublicKey
.
- See Also:
- Serialized Form
Fields inherited from interface java.security.PublicKey |
serialVersionUID |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
algorithm
private AlgorithmIdentifier algorithm
subjectPublicKey
private BIT_STRING subjectPublicKey
TAG
public static final Tag TAG
templateInstance
private static final SubjectPublicKeyInfo.Template templateInstance
SubjectPublicKeyInfo
private SubjectPublicKeyInfo()
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(AlgorithmIdentifier algorithm,
BIT_STRING subjectPublicKey)
SubjectPublicKeyInfo
public SubjectPublicKeyInfo(java.security.PublicKey pubk)
throws InvalidBERException,
java.io.IOException
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithm
in interface java.security.Key
getFormat
public java.lang.String getFormat()
- Specified by:
getFormat
in interface java.security.Key
getEncoded
public byte[] getEncoded()
- Specified by:
getEncoded
in interface java.security.Key
getAlgorithmIdentifier
public AlgorithmIdentifier getAlgorithmIdentifier()
getSubjectPublicKey
public BIT_STRING getSubjectPublicKey()
getTag
public Tag 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.
- Specified by:
getTag
in interface ASN1Value
encode
public void encode(java.io.OutputStream ostream)
throws java.io.IOException
- Description copied from interface:
ASN1Value
- Write this value's DER encoding to an output stream using
its own base tag.
- Specified by:
encode
in interface ASN1Value
encode
public void encode(Tag implicit,
java.io.OutputStream ostream)
throws java.io.IOException
- Description copied from interface:
ASN1Value
- Write this value's DER encoding to an output stream using
an implicit tag.
- Specified by:
encode
in interface ASN1Value
getTemplate
public static SubjectPublicKeyInfo.Template getTemplate()
toPublicKey
public java.security.PublicKey toPublicKey()
throws java.security.NoSuchAlgorithmException,
InvalidKeyFormatException
- Creates a PublicKey from the public key information. Currently
only RSA and DSA keys can be converted.
- Throws:
java.security.NoSuchAlgorithmException
- If the cryptographic provider
does not recognize the algorithm for this public key.InvalidKeyFormatException
- If the subjectPublicKey could
not be decoded correctly.