Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
RFC 5652: Content encryption key delivery mechanisms.

 KeyAgreeRecipientIdentifier ::= CHOICE {
     issuerAndSerialNumber IssuerAndSerialNumber,
     rKeyId [0] IMPLICIT RecipientKeyIdentifier }
 
 
     extends ASN1Object
     implements ASN1Choice
 {
     private RecipientKeyIdentifier rKeyID;

    
Return an KeyAgreeRecipientIdentifier object from a tagged object.

Parameters:
obj the tagged object holding the object we want.
explicit true if the object is meant to be explicitly tagged false otherwise.
Throws:
java.lang.IllegalArgumentException if the object held by the tagged object cannot be converted.
 
     public static KeyAgreeRecipientIdentifier getInstance(
         ASN1TaggedObject    obj,
         boolean             explicit)
     {
         return getInstance(ASN1Sequence.getInstance(objexplicit));
     }
    
    
Return an KeyAgreeRecipientIdentifier object from the given object.

Accepted inputs:

  • KeyAgreeRecipientIdentifier object
  • ASN1Sequence input formats with IssuerAndSerialNumber structure inside
  • ASN1TaggedObject with tag value 0: a KeyAgreeRecipientIdentifier data structure

Note: no byte[] input!

Parameters:
obj the object we want converted.
Throws:
java.lang.IllegalArgumentException if the object cannot be converted.
 
     public static KeyAgreeRecipientIdentifier getInstance(
         Object obj)
     {
         if (obj == null || obj instanceof KeyAgreeRecipientIdentifier)
         {
             return (KeyAgreeRecipientIdentifier)obj;
         }
         
         if (obj instanceof ASN1Sequence)
         {
             return new KeyAgreeRecipientIdentifier(IssuerAndSerialNumber.getInstance(obj));
         }
         
         if (obj instanceof ASN1TaggedObject && ((ASN1TaggedObject)obj).getTagNo() == 0)
         {
             return new KeyAgreeRecipientIdentifier(RecipientKeyIdentifier.getInstance(
                 (ASN1TaggedObject)objfalse));
         }
         
         throw new IllegalArgumentException("Invalid KeyAgreeRecipientIdentifier: " + obj.getClass().getName());
     } 
 
         IssuerAndSerialNumber issuerSerial)
     {
         this. = issuerSerial;
         this. = null;
     }
 
          RecipientKeyIdentifier rKeyID)
     {
         this. = null;
         this. = rKeyID;
     }
 
     {
         return ;
     }
 
     public RecipientKeyIdentifier getRKeyID()
    {
        return ;
    }

    
Produce an object suitable for an ASN1OutputStream.
    {
        if ( != null)
        {
            return .toASN1Primitive();
        }
        return new DERTaggedObject(false, 0, );
    }
New to GrepCode? Check out our FAQ X