Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.cms;
  
RFC 5652: Content encryption key delivery mechanisms.
 PasswordRecipientInfo ::= SEQUENCE {
     version       CMSVersion,   -- Always set to 0
     keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier
                             OPTIONAL,
     keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
     encryptedKey  EncryptedKey }
 
 
 public class PasswordRecipientInfo
     extends ASN1Object
 {
     private ASN1Integer          version;
     private ASN1OctetString     encryptedKey;
 
     public PasswordRecipientInfo(
         AlgorithmIdentifier     keyEncryptionAlgorithm,
         ASN1OctetString         encryptedKey)
     {
         this. = new ASN1Integer(0);
         this. = keyEncryptionAlgorithm;
         this. = encryptedKey;
     }
     
     public PasswordRecipientInfo(
         AlgorithmIdentifier     keyDerivationAlgorithm,
         AlgorithmIdentifier     keyEncryptionAlgorithm,
         ASN1OctetString         encryptedKey)
     {
         this. = new ASN1Integer(0);
         this. = keyDerivationAlgorithm;
         this. = keyEncryptionAlgorithm;
         this. = encryptedKey;
     }

    

Deprecated:
use getInstance() method.
 
     public PasswordRecipientInfo(
         ASN1Sequence seq)
     {
          = (ASN1Integer)seq.getObjectAt(0);
         if (seq.getObjectAt(1) instanceof ASN1TaggedObject)
         {
              = AlgorithmIdentifier.getInstance((ASN1TaggedObject)seq.getObjectAt(1), false);
              = AlgorithmIdentifier.getInstance(seq.getObjectAt(2));
              = (ASN1OctetString)seq.getObjectAt(3);
         }
         else
         {
              = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
              = (ASN1OctetString)seq.getObjectAt(2);
         }
     }

    
Return a PasswordRecipientInfo 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 PasswordRecipientInfo getInstance(
         ASN1TaggedObject    obj,
         boolean             explicit)
     {
         return getInstance(ASN1Sequence.getInstance(objexplicit));
     }
    
    
Return a PasswordRecipientInfo object from the given object.

Accepted inputs:

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

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

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