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

RecipientIdentifier

public class RecipientIdentifier extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.DEREncodable
id
Constructors Summary
public RecipientIdentifier(IssuerAndSerialNumber id)

        this.id = id;
    
public RecipientIdentifier(org.bouncycastle.asn1.ASN1OctetString id)

        this.id = new DERTaggedObject(false, 0, id);
    
public RecipientIdentifier(org.bouncycastle.asn1.DERObject id)

        this.id = id;
    
Methods Summary
public org.bouncycastle.asn1.DEREncodablegetId()

        if (id instanceof ASN1TaggedObject)
        {
            return ASN1OctetString.getInstance((ASN1TaggedObject)id, false);
        }

        return IssuerAndSerialNumber.getInstance(id);
    
public static org.bouncycastle.asn1.cms.RecipientIdentifiergetInstance(java.lang.Object o)
return a RecipientIdentifier object from the given object.

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

        if (o == null || o instanceof RecipientIdentifier)
        {
            return (RecipientIdentifier)o;
        }
        
        if (o instanceof IssuerAndSerialNumber)
        {
            return new RecipientIdentifier((IssuerAndSerialNumber)o);
        }
        
        if (o instanceof ASN1OctetString)
        {
            return new RecipientIdentifier((ASN1OctetString)o);
        }
        
        if (o instanceof DERObject)
        {
            return new RecipientIdentifier((DERObject)o);
        }
        
        throw new IllegalArgumentException(
          "Illegal object in RecipientIdentifier: " + o.getClass().getName());
    
public booleanisTagged()

        return (id instanceof ASN1TaggedObject);
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
RecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier
}

SubjectKeyIdentifier ::= OCTET STRING

        return id.getDERObject();