Start line:  
End line:  

Snippet Preview

Snippet HTML Code

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

 KeyAgreeRecipientInfo ::= SEQUENCE {
     version CMSVersion,  -- always set to 3
     originator [0] EXPLICIT OriginatorIdentifierOrKey,
     ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
     recipientEncryptedKeys RecipientEncryptedKeys 
 }

 UserKeyingMaterial ::= OCTET STRING
 
 
 public class KeyAgreeRecipientInfo
     extends ASN1Object
 {
     private ASN1Integer                  version;
     private OriginatorIdentifierOrKey   originator;
     private ASN1OctetString             ukm;
     private AlgorithmIdentifier         keyEncryptionAlgorithm;
     private ASN1Sequence                recipientEncryptedKeys;
     
     public KeyAgreeRecipientInfo(
         OriginatorIdentifierOrKey   originator,
         ASN1OctetString             ukm,
         AlgorithmIdentifier         keyEncryptionAlgorithm,
         ASN1Sequence                recipientEncryptedKeys)
     {
         this. = new ASN1Integer(3);
         this. = originator;
         this. = ukm;
         this. = keyEncryptionAlgorithm;
         this. = recipientEncryptedKeys;
     }

    

Deprecated:
use getInstance()
 
     public KeyAgreeRecipientInfo(
         ASN1Sequence seq)
     {
         int index = 0;
         
          = (ASN1Integer)seq.getObjectAt(index++);
          = OriginatorIdentifierOrKey.getInstance(
                             (ASN1TaggedObject)seq.getObjectAt(index++), true);
 
         if (seq.getObjectAt(indexinstanceof ASN1TaggedObject)
         {
              = ASN1OctetString.getInstance(
                             (ASN1TaggedObject)seq.getObjectAt(index++), true);
         }
 
          = AlgorithmIdentifier.getInstance(
                                                 seq.getObjectAt(index++));
 
          = (ASN1Sequence)seq.getObjectAt(index++);
     }
    
    
Return a KeyAgreeRecipientInfo 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 KeyAgreeRecipientInfo getInstance(
         ASN1TaggedObject    obj,
         boolean             explicit)
     {
         return getInstance(ASN1Sequence.getInstance(objexplicit));
     }
    
    
Return a KeyAgreeRecipientInfo object from the given object.

Accepted inputs:

  • null → null
  • KeyAgreeRecipientInfo object
  • ASN1Sequence input formats with KeyAgreeRecipientInfo structure inside

Parameters:
obj the object we want converted.
Throws:
java.lang.IllegalArgumentException if the object cannot be converted.
    public static KeyAgreeRecipientInfo getInstance(
        Object obj)
    {
        if (obj instanceof KeyAgreeRecipientInfo)
        {
            return (KeyAgreeRecipientInfo)obj;
        }
        
        if (obj != null)
        {
            return new KeyAgreeRecipientInfo(ASN1Sequence.getInstance(obj));
        }
        
        return null;
    } 
    public ASN1Integer getVersion()
    {
        return ;
    }
    {
        return ;
    }
    {
        return ;
    }
    {
        return ;
    }
    {
        return ;
    }

    
Produce an object suitable for an ASN1OutputStream.
    {
        ASN1EncodableVector  v = new ASN1EncodableVector();
        v.add();
        v.add(new DERTaggedObject(true, 0, ));
        
        if ( != null)
        {
            v.add(new DERTaggedObject(true, 1, ));
        }
        
        v.add();
        v.add();
        return new DERSequence(v);
    }
New to GrepCode? Check out our FAQ X