Google

Bouncy Castle Cryptography 1.11 API Specification: Class SubjectPublicKeyInfo
Bouncy Castle Cryptography 1.11

org.bouncycastle.asn1.x509
Class SubjectPublicKeyInfo

java.lang.Object
  |
  +--org.bouncycastle.asn1.x509.SubjectPublicKeyInfo
All Implemented Interfaces:
DEREncodable

public class SubjectPublicKeyInfo
extends java.lang.Object
implements DEREncodable

The object that contains the public key stored in a certficate.

The getEncoded() method in the public keys in the JCE produces a DER encoded one of these.


Constructor Summary
SubjectPublicKeyInfo(AlgorithmIdentifier algId, byte[] publicKey)
           
SubjectPublicKeyInfo(AlgorithmIdentifier algId, DERObject publicKey)
           
SubjectPublicKeyInfo(DERConstructedSequence seq)
           
 
Method Summary
 AlgorithmIdentifier getAlgorithmId()
           
 DERObject getDERObject()
           SubjectPublicKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, publicKey BIT STRING }
 DERObject getPublicKey()
          for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.
 DERBitString getPublicKeyData()
          for when the public key is raw bits...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId,
                            DERObject publicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(AlgorithmIdentifier algId,
                            byte[] publicKey)

SubjectPublicKeyInfo

public SubjectPublicKeyInfo(DERConstructedSequence seq)
Method Detail

getAlgorithmId

public AlgorithmIdentifier getAlgorithmId()

getPublicKey

public DERObject getPublicKey()
                       throws java.io.IOException
for when the public key is an encoded object - if the bitstring can't be decoded this routine throws an IOException.
Throws:
java.io.IOException - - if the bit string doesn't represent a DER encoded object.

getPublicKeyData

public DERBitString getPublicKeyData()
for when the public key is raw bits...

getDERObject

public DERObject getDERObject()
 SubjectPublicKeyInfo ::= SEQUENCE {
                          algorithm AlgorithmIdentifier,
                          publicKey BIT STRING }
 
Specified by:
getDERObject in interface DEREncodable

Bouncy Castle Cryptography 1.11