예제 #1
0
		public Pkcs12PbeParams(
            byte[]	salt,
            int		iterations)
        {
            this.iv = new DerOctetString(salt);
            this.iterations = new DerInteger(iterations);
        }
예제 #2
0
		public DataGroupHash(
            int				dataGroupNumber,
            Asn1OctetString	dataGroupHashValue)
        {
            this.dataGroupNumber = new DerInteger(dataGroupNumber);
            this.dataGroupHashValue = dataGroupHashValue;
        }
예제 #3
0
		public RC2CbcParameter(
            int		parameterVersion,
            byte[]	iv)
        {
            this.version = new DerInteger(parameterVersion);
            this.iv = new DerOctetString(iv);
        }
		public Cast5CbcParameters(
            byte[]	iv,
            int		keyLength)
        {
            this.iv = new DerOctetString(iv);
            this.keyLength = new DerInteger(keyLength);
        }
예제 #5
0
		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 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];
        }
예제 #8
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]);
		}
예제 #9
0
		public KekRecipientInfo(
            Asn1Sequence seq)
        {
            version = (DerInteger) seq[0];
            kekID = KekIdentifier.GetInstance(seq[1]);
            keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
            encryptedKey = (Asn1OctetString) seq[3];
        }
예제 #10
0
		public ResponderID(
            Asn1OctetString id)
        {
			if (id == null)
				throw new ArgumentNullException("id");

			this.id = id;
        }
        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]);
        }
예제 #12
0
		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];
        }
예제 #13
0
		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 RecipientKeyIdentifier(
			byte[]				subjectKeyIdentifier,
			DerGeneralizedTime	date,
			OtherKeyAttribute	other)
		{
			this.subjectKeyIdentifier = new DerOctetString(subjectKeyIdentifier);
			this.date = date;
			this.other = other;
		}
예제 #15
0
		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]);
        }
예제 #16
0
		public KekIdentifier(
            byte[]              keyIdentifier,
            DerGeneralizedTime  date,
            OtherKeyAttribute   other)
        {
            this.keyIdentifier = new DerOctetString(keyIdentifier);
            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;
        }
예제 #19
0
		public KekRecipientInfo(
            KekIdentifier       kekID,
            AlgorithmIdentifier keyEncryptionAlgorithm,
            Asn1OctetString     encryptedKey)
        {
            this.version = new DerInteger(4);
            this.kekID = kekID;
            this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
            this.encryptedKey = encryptedKey;
        }
예제 #20
0
 public BiometricData(
     TypeOfBiometricData	typeOfBiometricData,
     AlgorithmIdentifier	hashAlgorithm,
     Asn1OctetString		biometricDataHash)
 {
     this.typeOfBiometricData = typeOfBiometricData;
     this.hashAlgorithm = hashAlgorithm;
     this.biometricDataHash = biometricDataHash;
     this.sourceDataUri = null;
 }
		internal KeyAgreeRecipientInformation(
			KeyAgreeRecipientInfo	info,
			RecipientID				rid,
			Asn1OctetString			encryptedKey,
			CmsSecureReadable		secureReadable)
			: base(info.KeyEncryptionAlgorithm, secureReadable)
		{
			this.info = info;
			this.rid = rid;
			this.encryptedKey = encryptedKey;
		}
예제 #22
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]);
        }
예제 #23
0
		public CertID(
            AlgorithmIdentifier hashAlgorithm,
            Asn1OctetString     issuerNameHash,
            Asn1OctetString     issuerKeyHash,
            DerInteger          serialNumber)
        {
            this.hashAlgorithm = hashAlgorithm;
            this.issuerNameHash = issuerNameHash;
            this.issuerKeyHash = issuerKeyHash;
            this.serialNumber = serialNumber;
        }
예제 #24
0
		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 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 EncryptedContentInfo(
            Asn1Sequence seq)
        {
            contentType = (DerObjectIdentifier) seq[0];
            contentEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);

			if (seq.Count > 2)
            {
                encryptedContent = Asn1OctetString.GetInstance(
					(Asn1TaggedObject) seq[2], false);
            }
        }
예제 #27
0
		private BiometricData(
			Asn1Sequence seq)
        {
			typeOfBiometricData = TypeOfBiometricData.GetInstance(seq[0]);
			hashAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
			biometricDataHash = Asn1OctetString.GetInstance(seq[2]);

			if (seq.Count > 3)
			{
				sourceDataUri = DerIA5String.GetInstance(seq[3]);
			}
        }
예제 #28
0
		private static ICollection GetAlternativeName(
			Asn1OctetString extVal)
		{
			IList temp = Platform.CreateArrayList();

			if (extVal != null)
			{
				try
				{
					Asn1Sequence seq = DerSequence.GetInstance(FromExtensionValue(extVal));

					foreach (GeneralName genName in seq)
					{
                        IList list = Platform.CreateArrayList();
						list.Add(genName.TagNo);

						switch (genName.TagNo)
						{
							case GeneralName.EdiPartyName:
							case GeneralName.X400Address:
							case GeneralName.OtherName:
								list.Add(genName.Name.ToAsn1Object());
								break;
							case GeneralName.DirectoryName:
								list.Add(X509Name.GetInstance(genName.Name).ToString());
								break;
							case GeneralName.DnsName:
							case GeneralName.Rfc822Name:
							case GeneralName.UniformResourceIdentifier:
								list.Add(((IAsn1String)genName.Name).GetString());
								break;
							case GeneralName.RegisteredID:
								list.Add(DerObjectIdentifier.GetInstance(genName.Name).Id);
								break;
							case GeneralName.IPAddress:
								list.Add(DerOctetString.GetInstance(genName.Name).GetOctets());
								break;
							default:
								throw new IOException("Bad tag number: " + genName.TagNo);
						}

						temp.Add(list);
					}
				}
				catch (Exception e)
				{
					throw new CertificateParsingException(e.Message);
				}
			}

			return temp;
		}
예제 #29
0
		private RC2CbcParameter(
            Asn1Sequence seq)
        {
            if (seq.Count == 1)
            {
                iv = (Asn1OctetString)seq[0];
            }
            else
            {
                version = (DerInteger)seq[0];
                iv = (Asn1OctetString)seq[1];
            }
        }
		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];
            }
        }