FileDocCategorySizeDatePackage
AlgorithmIdentifier.javaAPI DocAzureus 3.0.3.42996Tue Jun 08 05:12:56 BST 2004org.bouncycastle.asn1.x509

AlgorithmIdentifier

public class AlgorithmIdentifier extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.DERObjectIdentifier
objectId
private org.bouncycastle.asn1.DEREncodable
parameters
private boolean
parametersDefined
Constructors Summary
public AlgorithmIdentifier(org.bouncycastle.asn1.DERObjectIdentifier objectId)

        this.objectId = objectId;
    
public AlgorithmIdentifier(String objectId)

        this.objectId = new DERObjectIdentifier(objectId);
    
public AlgorithmIdentifier(org.bouncycastle.asn1.DERObjectIdentifier objectId, org.bouncycastle.asn1.DEREncodable parameters)

        parametersDefined = true;
        this.objectId = objectId;
        this.parameters = parameters;
    
public AlgorithmIdentifier(org.bouncycastle.asn1.ASN1Sequence seq)

        objectId = (DERObjectIdentifier)seq.getObjectAt(0);

        if (seq.size() == 2)
        {
            parametersDefined = true;
            parameters = seq.getObjectAt(1);
        }
        else
        {
            parameters = null;
        }
    
Methods Summary
public static org.bouncycastle.asn1.x509.AlgorithmIdentifiergetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

	
       
         
                  
    
        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public static org.bouncycastle.asn1.x509.AlgorithmIdentifiergetInstance(java.lang.Object obj)

        if (obj instanceof AlgorithmIdentifier)
        {
            return (AlgorithmIdentifier)obj;
        }
        
        if (obj instanceof DERObjectIdentifier)
        {
            return new AlgorithmIdentifier((DERObjectIdentifier)obj);
        }

        if (obj instanceof String)
        {
            return new AlgorithmIdentifier((String)obj);
        }

        if (obj instanceof ASN1Sequence)
        {
            return new AlgorithmIdentifier((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public org.bouncycastle.asn1.DERObjectIdentifiergetObjectId()

        return objectId;
    
public org.bouncycastle.asn1.DEREncodablegetParameters()

        return parameters;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(objectId);

        if (parametersDefined)
        {
            v.add(parameters);
        }

        return new DERSequence(v);