FileDocCategorySizeDatePackage
OriginatorPublicKey.javaAPI DocAndroid 1.5 API2832Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.cms

OriginatorPublicKey

public class OriginatorPublicKey extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.x509.AlgorithmIdentifier
algorithm
private org.bouncycastle.asn1.DERBitString
publicKey
Constructors Summary
public OriginatorPublicKey(org.bouncycastle.asn1.x509.AlgorithmIdentifier algorithm, byte[] publicKey)

        this.algorithm = algorithm;
        this.publicKey = new DERBitString(publicKey);
    
public OriginatorPublicKey(org.bouncycastle.asn1.ASN1Sequence seq)

        algorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(0));
        publicKey = (DERBitString)seq.getObjectAt(1);
    
Methods Summary
public org.bouncycastle.asn1.x509.AlgorithmIdentifiergetAlgorithm()

        return algorithm;
    
public static org.bouncycastle.asn1.cms.OriginatorPublicKeygetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)
return an OriginatorPublicKey object from a tagged object.

param
obj the tagged object holding the object we want.
param
explicit true if the object is meant to be explicitly tagged false otherwise.
exception
IllegalArgumentException if the object held by the tagged object cannot be converted.

        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public static org.bouncycastle.asn1.cms.OriginatorPublicKeygetInstance(java.lang.Object obj)
return an OriginatorPublicKey object from the given object.

param
obj the object we want converted.
exception
IllegalArgumentException if the object cannot be converted.

        if (obj == null || obj instanceof OriginatorPublicKey)
        {
            return (OriginatorPublicKey)obj;
        }
        
        if (obj instanceof ASN1Sequence)
        {
            return new OriginatorPublicKey((ASN1Sequence)obj);
        }
        
        throw new IllegalArgumentException("Invalid OriginatorPublicKey: " + obj.getClass().getName());
    
public org.bouncycastle.asn1.DERBitStringgetPublicKey()

        return publicKey;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
OriginatorPublicKey ::= SEQUENCE {
algorithm AlgorithmIdentifier,
publicKey BIT STRING
}

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(algorithm);
        v.add(publicKey);

        return new DERSequence(v);