public Cast5CbcParameters(
     byte[]	iv,
     int		keyLength)
 {
     this.iv = new DerOctetString(iv);
     this.keyLength = new DerInteger(keyLength);
 }
 public DataGroupHash(
     int				dataGroupNumber,
     Asn1OctetString	dataGroupHashValue)
 {
     this.dataGroupNumber = new DerInteger(dataGroupNumber);
     this.dataGroupHashValue = dataGroupHashValue;
 }
 public RC2CbcParameter(
     int		parameterVersion,
     byte[]	iv)
 {
     this.version = new DerInteger(parameterVersion);
     this.iv = new DerOctetString(iv);
 }
        public KekIdentifier(
            Asn1Sequence seq)
        {
            keyIdentifier = (Asn1OctetString) seq[0];

            switch (seq.Count)
            {
            case 1:
                break;
            case 2:
                if (seq[1] is DerGeneralizedTime)
                {
                    date = (DerGeneralizedTime) seq[1];
                }
                else
                {
                    other = OtherKeyAttribute.GetInstance(seq[2]);
                }
                break;
            case 3:
                date  = (DerGeneralizedTime) seq[1];
                other = OtherKeyAttribute.GetInstance(seq[2]);
                break;
            default:
                throw new ArgumentException("Invalid KekIdentifier");
            }
        }
 public Pkcs12PbeParams(
     byte[]	salt,
     int		iterations)
 {
     this.iv = new DerOctetString(salt);
     this.iterations = new DerInteger(iterations);
 }
 public KekRecipientInfo(
     Asn1Sequence seq)
 {
     version = (DerInteger) seq[0];
     kekID = KekIdentifier.GetInstance(seq[1]);
     keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
     encryptedKey = (Asn1OctetString) seq[3];
 }
Esempio n. 7
0
 private IdeaCbcPar(
     Asn1Sequence seq)
 {
     if (seq.Count == 1)
     {
         iv = (Asn1OctetString) seq[0];
     }
 }
        private PbeParameter(Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            salt = Asn1OctetString.GetInstance(seq[0]);
            iterationCount = DerInteger.GetInstance(seq[1]);
        }
        public ResponderID(
            Asn1OctetString id)
        {
            if (id == null)
                throw new ArgumentNullException("id");

            this.id = id;
        }
 public PasswordRecipientInfo(
     AlgorithmIdentifier	keyEncryptionAlgorithm,
     Asn1OctetString		encryptedKey)
 {
     this.version = new DerInteger(0);
     this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
     this.encryptedKey = encryptedKey;
 }
 public KeyTransRecipientInfo(
     Asn1Sequence seq)
 {
     this.version = (DerInteger) seq[0];
     this.rid = RecipientIdentifier.GetInstance(seq[1]);
     this.keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
     this.encryptedKey = (Asn1OctetString) seq[3];
 }
        private DataGroupHash(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            this.dataGroupNumber = DerInteger.GetInstance(seq[0]);
            this.dataGroupHashValue = Asn1OctetString.GetInstance(seq[1]);
        }
 public KekIdentifier(
     byte[]              keyIdentifier,
     DerGeneralizedTime  date,
     OtherKeyAttribute   other)
 {
     this.keyIdentifier = new DerOctetString(keyIdentifier);
     this.date = date;
     this.other = other;
 }
        private Gost28147Parameters(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            this.iv = Asn1OctetString.GetInstance(seq[0]);
            this.paramSet = DerObjectIdentifier.GetInstance(seq[1]);
        }
        private ResponseBytes(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            this.responseType = DerObjectIdentifier.GetInstance(seq[0]);
            this.response = Asn1OctetString.GetInstance(seq[1]);
        }
 public RecipientKeyIdentifier(
     byte[]				subjectKeyIdentifier,
     DerGeneralizedTime	date,
     OtherKeyAttribute	other)
 {
     this.subjectKeyIdentifier = new DerOctetString(subjectKeyIdentifier);
     this.date = date;
     this.other = other;
 }
 public RecipientKeyIdentifier(
     Asn1OctetString         subjectKeyIdentifier,
     DerGeneralizedTime      date,
     OtherKeyAttribute       other)
 {
     this.subjectKeyIdentifier = subjectKeyIdentifier;
     this.date = date;
     this.other = other;
 }
 public EncryptedContentInfo(
     DerObjectIdentifier	contentType,
     AlgorithmIdentifier	contentEncryptionAlgorithm,
     Asn1OctetString		encryptedContent)
 {
     this.contentType = contentType;
     this.contentEncryptionAlgorithm = contentEncryptionAlgorithm;
     this.encryptedContent = encryptedContent;
 }
        private Cast5CbcParameters(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            iv = (Asn1OctetString) seq[0];
            keyLength = (DerInteger) seq[1];
        }
 public KekRecipientInfo(
     KekIdentifier       kekID,
     AlgorithmIdentifier keyEncryptionAlgorithm,
     Asn1OctetString     encryptedKey)
 {
     this.version = new DerInteger(4);
     this.kekID = kekID;
     this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
     this.encryptedKey = encryptedKey;
 }
Esempio n. 21
0
        private CertID(
            Asn1Sequence seq)
        {
            if (seq.Count != 4)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            this.hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]);
            this.issuerNameHash = Asn1OctetString.GetInstance(seq[1]);
            this.issuerKeyHash = Asn1OctetString.GetInstance(seq[2]);
            this.serialNumber = DerInteger.GetInstance(seq[3]);
        }
Esempio n. 22
0
 public CertID(
     AlgorithmIdentifier hashAlgorithm,
     Asn1OctetString     issuerNameHash,
     Asn1OctetString     issuerKeyHash,
     DerInteger          serialNumber)
 {
     this.hashAlgorithm = hashAlgorithm;
     this.issuerNameHash = issuerNameHash;
     this.issuerKeyHash = issuerKeyHash;
     this.serialNumber = serialNumber;
 }
 public KeyAgreeRecipientInfo(
     OriginatorIdentifierOrKey   originator,
     Asn1OctetString             ukm,
     AlgorithmIdentifier         keyEncryptionAlgorithm,
     Asn1Sequence                recipientEncryptedKeys)
 {
     this.version = new DerInteger(3);
     this.originator = originator;
     this.ukm = ukm;
     this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
     this.recipientEncryptedKeys = recipientEncryptedKeys;
 }
        public ResponseBytes(
            DerObjectIdentifier	responseType,
            Asn1OctetString		response)
        {
            if (responseType == null)
                throw new ArgumentNullException("responseType");
            if (response == null)
                throw new ArgumentNullException("response");

            this.responseType = responseType;
            this.response = response;
        }
        public EncryptedContentInfo(
            Asn1Sequence seq)
        {
            contentType = (DerObjectIdentifier) seq[0];
            contentEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);

            if (seq.Count > 2)
            {
                encryptedContent = Asn1OctetString.GetInstance(
                    (Asn1TaggedObject) seq[2], false);
            }
        }
 private RC2CbcParameter(
     Asn1Sequence seq)
 {
     if (seq.Count == 1)
     {
         iv = (Asn1OctetString)seq[0];
     }
     else
     {
         version = (DerInteger)seq[0];
         iv = (Asn1OctetString)seq[1];
     }
 }
Esempio n. 27
0
 public SignerInfo(
     SignerIdentifier        sid,
     AlgorithmIdentifier     digAlgorithm,
     Attributes              authenticatedAttributes,
     AlgorithmIdentifier     digEncryptionAlgorithm,
     Asn1OctetString         encryptedDigest,
     Attributes              unauthenticatedAttributes)
 {
     this.version = new DerInteger(sid.IsTagged ? 3 : 1);
     this.sid = sid;
     this.digAlgorithm = digAlgorithm;
     this.authenticatedAttributes = Asn1Set.GetInstance(authenticatedAttributes);
     this.digEncryptionAlgorithm = digEncryptionAlgorithm;
     this.encryptedDigest = encryptedDigest;
     this.unauthenticatedAttributes = Asn1Set.GetInstance(unauthenticatedAttributes);
 }
        public PasswordRecipientInfo(
            Asn1Sequence seq)
        {
            version = (DerInteger) seq[0];

            if (seq[1] is Asn1TaggedObject)
            {
                keyDerivationAlgorithm = AlgorithmIdentifier.GetInstance((Asn1TaggedObject) seq[1], false);
                keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
                encryptedKey = (Asn1OctetString) seq[3];
            }
            else
            {
                keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
                encryptedKey = (Asn1OctetString) seq[2];
            }
        }
Esempio n. 29
0
 public SignerInfo(
     DerInteger              version,
     IssuerAndSerialNumber   issuerAndSerialNumber,
     AlgorithmIdentifier     digAlgorithm,
     Asn1Set                 authenticatedAttributes,
     AlgorithmIdentifier     digEncryptionAlgorithm,
     Asn1OctetString         encryptedDigest,
     Asn1Set                 unauthenticatedAttributes)
 {
     this.version = version;
     this.issuerAndSerialNumber = issuerAndSerialNumber;
     this.digAlgorithm = digAlgorithm;
     this.authenticatedAttributes = authenticatedAttributes;
     this.digEncryptionAlgorithm = digEncryptionAlgorithm;
     this.encryptedDigest = encryptedDigest;
     this.unauthenticatedAttributes = unauthenticatedAttributes;
 }
        public KeyTransRecipientInfo(
            RecipientIdentifier rid,
            AlgorithmIdentifier keyEncryptionAlgorithm,
            Asn1OctetString     encryptedKey)
        {
            if (rid.ToAsn1Object() is Asn1TaggedObject)
            {
                this.version = new DerInteger(2);
            }
            else
            {
                this.version = new DerInteger(0);
            }

            this.rid = rid;
            this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
            this.encryptedKey = encryptedKey;
        }