JSS 3.1

org.mozilla.jss.pkix.primitive
Class SubjectPublicKeyInfo

java.lang.Object
  |
  +--org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo

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

Inner Class Summary
static class SubjectPublicKeyInfo.Template
           
 
Field Summary
private  AlgorithmIdentifier algorithm
           
private  BIT_STRING subjectPublicKey
           
static Tag TAG
           
private static SubjectPublicKeyInfo.Template templateInstance
           
 
Constructor Summary
private SubjectPublicKeyInfo()
           
  SubjectPublicKeyInfo(AlgorithmIdentifier algorithm, BIT_STRING subjectPublicKey)
           
  SubjectPublicKeyInfo(java.security.PublicKey pubk)
           
 
Method Summary
 void encode(java.io.OutputStream ostream)
           
 void encode(Tag implicit, java.io.OutputStream ostream)
           
 java.lang.String getAlgorithm()
           
 AlgorithmIdentifier getAlgorithmIdentifier()
           
 byte[] getEncoded()
           
 java.lang.String getFormat()
           
 BIT_STRING getSubjectPublicKey()
           
 Tag getTag()
           
static SubjectPublicKeyInfo.Template getTemplate()
           
 java.security.PublicKey toPublicKey()
          Creates a PublicKey from the public key information.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

algorithm

private AlgorithmIdentifier algorithm

subjectPublicKey

private BIT_STRING subjectPublicKey

TAG

public static final Tag TAG

templateInstance

private static final SubjectPublicKeyInfo.Template templateInstance
Constructor Detail

SubjectPublicKeyInfo

private SubjectPublicKeyInfo()

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algorithm,
                            BIT_STRING subjectPublicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(java.security.PublicKey pubk)
                     throws InvalidBERException,
                            java.io.IOException
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()

getFormat

public java.lang.String getFormat()

getEncoded

public byte[] getEncoded()

getAlgorithmIdentifier

public AlgorithmIdentifier getAlgorithmIdentifier()

getSubjectPublicKey

public BIT_STRING getSubjectPublicKey()

getTag

public Tag getTag()
Specified by:
getTag in interface ASN1Value

encode

public void encode(java.io.OutputStream ostream)
            throws java.io.IOException
Specified by:
encode in interface ASN1Value

encode

public void encode(Tag implicit,
                   java.io.OutputStream ostream)
            throws java.io.IOException
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.

JSS 3.1