org.mozilla.jss.pkix.primitive

Class SubjectPublicKeyInfo

public class SubjectPublicKeyInfo extends X509EncodedKeySpec implements ASN1Value, PublicKey

A SubjectPublicKeyInfo, which stores information about a public key. This class implements java.security.PublicKey.
Nested Class Summary
static classSubjectPublicKeyInfo.Template
Field Summary
static TagTAG
Constructor Summary
SubjectPublicKeyInfo(AlgorithmIdentifier algorithm, BIT_STRING subjectPublicKey)
SubjectPublicKeyInfo(PublicKey pubk)
Method Summary
voidencode(OutputStream ostream)
voidencode(Tag implicit, OutputStream ostream)
StringgetAlgorithm()
AlgorithmIdentifiergetAlgorithmIdentifier()
byte[]getEncoded()
BIT_STRINGgetSubjectPublicKey()
TaggetTag()
static SubjectPublicKeyInfo.TemplategetTemplate()
PublicKeytoPublicKey()
Creates a PublicKey from the public key information.

Field Detail

TAG

public static final Tag TAG

Constructor Detail

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algorithm, BIT_STRING subjectPublicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(PublicKey pubk)

Method Detail

encode

public void encode(OutputStream ostream)

encode

public void encode(Tag implicit, OutputStream ostream)

getAlgorithm

public String getAlgorithm()

getAlgorithmIdentifier

public AlgorithmIdentifier getAlgorithmIdentifier()

getEncoded

public byte[] getEncoded()

getSubjectPublicKey

public BIT_STRING getSubjectPublicKey()

getTag

public Tag getTag()

getTemplate

public static SubjectPublicKeyInfo.Template getTemplate()

toPublicKey

public PublicKey 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.