Inheritance: Org.BouncyCastle.Asn1.X509.AlgorithmIdentifier
Ejemplo n.º 1
0
        public PbeS2Parameters(Asn1Sequence seq)
        {
            if (seq.Count != 2)
            {
                throw new ArgumentException("Wrong number of elements in sequence", "seq");
            }
            Asn1Sequence asn1Sequence = (Asn1Sequence)seq[0].ToAsn1Object();

            if (asn1Sequence[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
                this.func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2, Pbkdf2Params.GetInstance(asn1Sequence[1]));
            }
            else
            {
                this.func = new KeyDerivationFunc(asn1Sequence);
            }
            this.scheme = EncryptionScheme.GetInstance(seq[1].ToAsn1Object());
        }
Ejemplo n.º 2
0
        public PbeS2Parameters(Asn1Sequence seq)
        {
            //IL_0019: Unknown result type (might be due to invalid IL or missing references)
            if (seq.Count != 2)
            {
                throw new ArgumentException("Wrong number of elements in sequence", "seq");
            }
            Asn1Sequence asn1Sequence = (Asn1Sequence)seq[0].ToAsn1Object();

            if (asn1Sequence[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
                func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2, Pbkdf2Params.GetInstance(asn1Sequence[1]));
            }
            else
            {
                func = new KeyDerivationFunc(asn1Sequence);
            }
            scheme = EncryptionScheme.GetInstance(seq[1].ToAsn1Object());
        }
Ejemplo n.º 3
0
        public PbeS2Parameters(
            Asn1Sequence obj)
        {
            IEnumerator e = obj.GetEnumerator();

            e.MoveNext();
            Asn1Sequence funcSeq = (Asn1Sequence) e.Current;

            if (funcSeq[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
                func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2, funcSeq[1]);
            }
            else
            {
                func = new KeyDerivationFunc(funcSeq);
            }

            e.MoveNext();
            scheme = new EncryptionScheme((Asn1Sequence) e.Current);
        }
Ejemplo n.º 4
0
        public PbeS2Parameters(
            Asn1Sequence obj)
        {
            IEnumerator e = obj.GetEnumerator();

            e.MoveNext();
            Asn1Sequence funcSeq = (Asn1Sequence)e.Current;

            if (funcSeq[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
                func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2, funcSeq[1]);
            }
            else
            {
                func = new KeyDerivationFunc(funcSeq);
            }

            e.MoveNext();
            scheme = new EncryptionScheme((Asn1Sequence)e.Current);
        }
Ejemplo n.º 5
0
		public PbeS2Parameters(
            Asn1Sequence seq)
        {
			if (seq.Count != 2)
				throw new ArgumentException("Wrong number of elements in sequence", "seq");

			Asn1Sequence funcSeq = (Asn1Sequence)seq[0].ToAsn1Object();

			// TODO Not sure if this special case is really necessary/appropriate
			if (funcSeq[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
				func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2,
					Pbkdf2Params.GetInstance(funcSeq[1]));
			}
            else
            {
                func = new KeyDerivationFunc(funcSeq);
            }

			scheme = EncryptionScheme.GetInstance(seq[1].ToAsn1Object());
        }
Ejemplo n.º 6
0
        public PbeS2Parameters(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
            {
                throw new ArgumentException("Wrong number of elements in sequence", "seq");
            }

            Asn1Sequence funcSeq = (Asn1Sequence)seq[0].ToAsn1Object();

            // TODO Not sure if this special case is really necessary/appropriate
            if (funcSeq[0].Equals(PkcsObjectIdentifiers.IdPbkdf2))
            {
                func = new KeyDerivationFunc(PkcsObjectIdentifiers.IdPbkdf2,
                                             Pbkdf2Params.GetInstance(funcSeq[1]));
            }
            else
            {
                func = new KeyDerivationFunc(funcSeq);
            }

            scheme = EncryptionScheme.GetInstance(seq[1].ToAsn1Object());
        }
Ejemplo n.º 7
0
 public PbeS2Parameters(KeyDerivationFunc keyDevFunc, EncryptionScheme encScheme)
 {
     this.func   = keyDevFunc;
     this.scheme = encScheme;
 }
Ejemplo n.º 8
0
 public PbeS2Parameters(KeyDerivationFunc keyDevFunc, EncryptionScheme encScheme)
 {
     this.func = keyDevFunc;
     this.scheme = encScheme;
 }