public ElGamalParameter( BigInteger p, BigInteger g) { this.p = new DerInteger(p); this.g = new DerInteger(g); }
public Pkcs12PbeParams( byte[] salt, int iterations) { this.iv = new DerOctetString(salt); this.iterations = new DerInteger(iterations); }
public Cast5CbcParameters( byte[] iv, int keyLength) { this.iv = new DerOctetString(iv); this.keyLength = new DerInteger(keyLength); }
private LdsSecurityObject( Asn1Sequence seq) { if (seq == null || seq.Count == 0) throw new ArgumentException("null or empty sequence passed."); IEnumerator e = seq.GetEnumerator(); // version e.MoveNext(); version = DerInteger.GetInstance(e.Current); // digestAlgorithmIdentifier e.MoveNext(); digestAlgorithmIdentifier = AlgorithmIdentifier.GetInstance(e.Current); e.MoveNext(); Asn1Sequence datagroupHashSeq = Asn1Sequence.GetInstance(e.Current); if (version.Value.Equals(BigInteger.One)) { e.MoveNext(); versionInfo = LdsVersionInfo.GetInstance(e.Current); } CheckDatagroupHashSeqSize(datagroupHashSeq.Count); datagroupHash = new DataGroupHash[datagroupHashSeq.Count]; for (int i= 0; i< datagroupHashSeq.Count; i++) { datagroupHash[i] = DataGroupHash.GetInstance(datagroupHashSeq[i]); } }
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 CompressedDataParser( Asn1SequenceParser seq) { this._version = (DerInteger)seq.ReadObject(); this._compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq.ReadObject().ToAsn1Object()); this._encapContentInfo = new ContentInfoParser((Asn1SequenceParser)seq.ReadObject()); }
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 KekRecipientInfo( Asn1Sequence seq) { version = (DerInteger) seq[0]; kekID = KekIdentifier.GetInstance(seq[1]); keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]); encryptedKey = (Asn1OctetString) seq[3]; }
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 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 ElGamalParameter( Asn1Sequence seq) { if (seq.Count != 2) throw new ArgumentException("Wrong number of elements in sequence", "seq"); p = DerInteger.GetInstance(seq[0]); g = DerInteger.GetInstance(seq[1]); }
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 KekRecipientInfo( KekIdentifier kekID, AlgorithmIdentifier keyEncryptionAlgorithm, Asn1OctetString encryptedKey) { this.version = new DerInteger(4); this.kekID = kekID; this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; this.encryptedKey = encryptedKey; }
public LdsSecurityObject( AlgorithmIdentifier digestAlgorithmIdentifier, DataGroupHash[] datagroupHash) { this.version = new DerInteger(0); this.digestAlgorithmIdentifier = digestAlgorithmIdentifier; this.datagroupHash = datagroupHash; CheckDatagroupHashSeqSize(datagroupHash.Length); }
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]); }
public CertID( AlgorithmIdentifier hashAlgorithm, Asn1OctetString issuerNameHash, Asn1OctetString issuerKeyHash, DerInteger serialNumber) { this.hashAlgorithm = hashAlgorithm; this.issuerNameHash = issuerNameHash; this.issuerKeyHash = issuerKeyHash; this.serialNumber = serialNumber; }
public EnvelopedData( OriginatorInfo originatorInfo, Asn1Set recipientInfos, EncryptedContentInfo encryptedContentInfo, Attributes unprotectedAttrs) { this.version = new DerInteger(CalculateVersion(originatorInfo, recipientInfos, Asn1Set.GetInstance(unprotectedAttrs))); this.originatorInfo = originatorInfo; this.recipientInfos = recipientInfos; this.encryptedContentInfo = encryptedContentInfo; this.unprotectedAttrs = Asn1Set.GetInstance(unprotectedAttrs); }
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 DHParameter( BigInteger p, BigInteger g, int l) { this.p = new DerInteger(p); this.g = new DerInteger(g); if (l != 0) { this.l = new DerInteger(l); } }
private RC2CbcParameter( Asn1Sequence seq) { if (seq.Count == 1) { iv = (Asn1OctetString)seq[0]; } else { version = (DerInteger)seq[0]; iv = (Asn1OctetString)seq[1]; } }
public SignedData( DerInteger _version, Asn1Set _digestAlgorithms, ContentInfo _contentInfo, Asn1Set _certificates, Asn1Set _crls, Asn1Set _signerInfos) { version = _version; digestAlgorithms = _digestAlgorithms; contentInfo = _contentInfo; certificates = _certificates; crls = _crls; signerInfos = _signerInfos; }
public SignedData( Asn1Set digestAlgorithms, ContentInfo contentInfo, Asn1Set certificates, Asn1Set crls, Asn1Set signerInfos) { this.version = CalculateVersion(contentInfo.ContentType, certificates, crls, signerInfos); this.digestAlgorithms = digestAlgorithms; this.contentInfo = contentInfo; this.certificates = certificates; this.crls = crls; this.signerInfos = signerInfos; this.crlsBer = crls is BerSet; this.certsBer = certificates is BerSet; }
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 DHParameter( Asn1Sequence seq) { IEnumerator e = seq.GetEnumerator(); e.MoveNext(); p = (DerInteger)e.Current; e.MoveNext(); g = (DerInteger)e.Current; if (e.MoveNext()) { l = (DerInteger) e.Current; } }
private SignedData( Asn1Sequence seq) { IEnumerator e = seq.GetEnumerator(); e.MoveNext(); version = (DerInteger)e.Current; e.MoveNext(); digestAlgorithms = ((Asn1Set)e.Current); e.MoveNext(); contentInfo = ContentInfo.GetInstance(e.Current); while (e.MoveNext()) { Asn1Object o = (Asn1Object)e.Current; // // an interesting feature of SignedData is that there appear // to be varying implementations... // for the moment we ignore anything which doesn't fit. // if (o is Asn1TaggedObject) { Asn1TaggedObject tagged = (Asn1TaggedObject)o; switch (tagged.TagNo) { case 0: certsBer = tagged is BerTaggedObject; certificates = Asn1Set.GetInstance(tagged, false); break; case 1: crlsBer = tagged is BerTaggedObject; crls = Asn1Set.GetInstance(tagged, false); break; default: throw new ArgumentException("unknown tag value " + tagged.TagNo); } } else { signerInfos = (Asn1Set) o; } } }
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 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]; } }
public DerExternal( Asn1EncodableVector vector) { int offset = 0; Asn1Object enc = GetObjFromVector(vector, offset); if (enc is DerObjectIdentifier) { directReference = (DerObjectIdentifier)enc; offset++; enc = GetObjFromVector(vector, offset); } if (enc is DerInteger) { indirectReference = (DerInteger) enc; offset++; enc = GetObjFromVector(vector, offset); } if (!(enc is DerTaggedObject)) { dataValueDescriptor = (Asn1Object) enc; offset++; enc = GetObjFromVector(vector, offset); } if (!(enc is DerTaggedObject)) { throw new InvalidOperationException( "No tagged object found in vector. Structure doesn't seem to be of type External"); } if (vector.Count != offset + 1) throw new ArgumentException("input vector too large", "vector"); if (!(enc is DerTaggedObject)) throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector"); DerTaggedObject obj = (DerTaggedObject)enc; // Use property accessor to include check on value Encoding = obj.TagNo; if (encoding < 0 || encoding > 2) throw new InvalidOperationException("invalid encoding value"); externalContent = obj.GetObject(); }