public CompressedData( Asn1Sequence seq) { this.version = (DerInteger) seq[0]; this.compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]); this.encapContentInfo = ContentInfo.GetInstance(seq[2]); }
public PbeParameter( byte[] salt, int iterationCount) { this.octStr = new DerOctetString(salt); this.iterationCount = new DerInteger(iterationCount); }
public ElGamalParameter( IBigInteger p, IBigInteger g) { this.p = new DerInteger(p); this.g = new DerInteger(g); }
public IssuerAndSerialNumber( X509Name name, DerInteger serialNumber) { this.name = name; this.serialNumber = serialNumber; }
public IssuerAndSerialNumber( X509Name name, BigInteger serialNumber) { this.name = name; this.serialNumber = new DerInteger(serialNumber); }
public RC2CbcParameter( int parameterVersion, byte[] iv) { this.version = new DerInteger(parameterVersion); this.iv = new DerOctetString(iv); }
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); }
public DataGroupHash( int dataGroupNumber, Asn1OctetString dataGroupHashValue) { this.dataGroupNumber = new DerInteger(dataGroupNumber); this.dataGroupHashValue = dataGroupHashValue; }
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]); } }
private AttributeCertificateInfo( Asn1Sequence seq) { if (seq.Count < 7 || seq.Count > 9) { throw new ArgumentException("Bad sequence size: " + seq.Count); } this.version = DerInteger.GetInstance(seq[0]); this.holder = Holder.GetInstance(seq[1]); this.issuer = AttCertIssuer.GetInstance(seq[2]); this.signature = AlgorithmIdentifier.GetInstance(seq[3]); this.serialNumber = DerInteger.GetInstance(seq[4]); this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]); this.attributes = Asn1Sequence.GetInstance(seq[6]); for (int i = 7; i < seq.Count; i++) { Asn1Encodable obj = (Asn1Encodable) seq[i]; if (obj is DerBitString) { this.issuerUniqueID = DerBitString.GetInstance(seq[i]); } else if (obj is Asn1Sequence || obj is X509Extensions) { this.extensions = X509Extensions.GetInstance(seq[i]); } } }
public CompressedDataParser( Asn1SequenceParser seq) { this._version = (DerInteger)seq.ReadObject(); this._compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq.ReadObject().ToAsn1Object()); this._encapContentInfo = new ContentInfoParser((Asn1SequenceParser)seq.ReadObject()); }
public EnvelopedData( OriginatorInfo originatorInfo, Asn1Set recipientInfos, EncryptedContentInfo encryptedContentInfo, Asn1Set unprotectedAttrs) { if (originatorInfo != null || unprotectedAttrs != null) { version = new DerInteger(2); } else { version = new DerInteger(0); foreach (object o in recipientInfos) { RecipientInfo ri = RecipientInfo.GetInstance(o); if (!ri.Version.Equals(version)) { version = new DerInteger(2); break; } } } this.originatorInfo = originatorInfo; this.recipientInfos = recipientInfos; this.encryptedContentInfo = encryptedContentInfo; this.unprotectedAttrs = unprotectedAttrs; }
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]; }
/** * Creates a new instance of DerExternal. * See X.690 for more informations about the meaning of these parameters * @param directReference The direct reference or <code>null</code> if not set. * @param indirectReference The indirect reference or <code>null</code> if not set. * @param dataValueDescriptor The data value descriptor or <code>null</code> if not set. * @param encoding The encoding to be used for the external data * @param externalData The external data */ public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, Asn1Object dataValueDescriptor, int encoding, Asn1Object externalData) { DirectReference = directReference; IndirectReference = indirectReference; DataValueDescriptor = dataValueDescriptor; Encoding = encoding; ExternalContent = externalData.ToAsn1Object(); }
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; }
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 CompressedData( AlgorithmIdentifier compressionAlgorithm, ContentInfo encapContentInfo) { this.version = new DerInteger(0); this.compressionAlgorithm = compressionAlgorithm; this.encapContentInfo = encapContentInfo; }
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]; }
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 MonetaryValue( Iso4217CurrencyCode currency, int amount, int exponent) { this.currency = currency; this.amount = new DerInteger(amount); this.exponent = new DerInteger(exponent); }
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]); }
public LdsSecurityObject( AlgorithmIdentifier digestAlgorithmIdentifier, DataGroupHash[] datagroupHash) { this.version = new DerInteger(0); this.digestAlgorithmIdentifier = digestAlgorithmIdentifier; this.datagroupHash = datagroupHash; CheckDatagroupHashSeqSize(datagroupHash.Length); }
public TbsRequest( GeneralName requestorName, Asn1Sequence requestList, X509Extensions requestExtensions) { this.version = V1; this.requestorName = requestorName; this.requestList = requestList; this.requestExtensions = requestExtensions; }
private MonetaryValue( Asn1Sequence seq) { if (seq.Count != 3) throw new ArgumentException("Bad sequence size: " + seq.Count, "seq"); currency = Iso4217CurrencyCode.GetInstance(seq[0]); amount = DerInteger.GetInstance(seq[1]); exponent = DerInteger.GetInstance(seq[2]); }
public KekRecipientInfo( KekIdentifier kekID, AlgorithmIdentifier keyEncryptionAlgorithm, Asn1OctetString encryptedKey) { this.version = new DerInteger(4); this.kekID = kekID; this.keyEncryptionAlgorithm = keyEncryptionAlgorithm; this.encryptedKey = encryptedKey; }
private Gost3410ParamSetParameters( Asn1Sequence seq) { if (seq.Count != 4) throw new ArgumentException("Wrong number of elements in sequence", "seq"); this.keySize = DerInteger.GetInstance(seq[0]).Value.IntValue; this.p = DerInteger.GetInstance(seq[1]); this.q = DerInteger.GetInstance(seq[2]); this.a = DerInteger.GetInstance(seq[3]); }
public Gost3410ParamSetParameters( int keySize, BigInteger p, BigInteger q, BigInteger a) { this.keySize = keySize; this.p = new DerInteger(p); this.q = new DerInteger(q); this.a = new DerInteger(a); }
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 DerExternal(Asn1EncodableVector vector) { int num = 0; Asn1Object objFromVector = GetObjFromVector(vector, num); if (objFromVector is DerObjectIdentifier) { directReference = (DerObjectIdentifier)objFromVector; num++; objFromVector = GetObjFromVector(vector, num); } if (objFromVector is DerInteger) { indirectReference = (DerInteger)objFromVector; num++; objFromVector = GetObjFromVector(vector, num); } if (!(objFromVector is DerTaggedObject)) { dataValueDescriptor = objFromVector; num++; objFromVector = GetObjFromVector(vector, num); } if (!(objFromVector is DerTaggedObject)) { throw new InvalidOperationException("No tagged object found in vector. Structure doesn't seem to be of type External"); } if (vector.Count != num + 1) { throw new ArgumentException("input vector too large", "vector"); } if (!(objFromVector is DerTaggedObject)) { throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector"); } DerTaggedObject derTaggedObject = (DerTaggedObject)objFromVector; Encoding = derTaggedObject.TagNo; if (encoding < 0 || encoding > 2) { throw new InvalidOperationException("invalid encoding value"); } externalContent = derTaggedObject.GetObject(); }
protected override bool Asn1Equals(Asn1Object asn1Object) { DerInteger derInteger = asn1Object as DerInteger; return(derInteger != null && Arrays.AreEqual(this.bytes, derInteger.bytes)); }
/** * Creates a new instance of DerExternal * See X.690 for more informations about the meaning of these parameters * @param directReference The direct reference or <code>null</code> if not set. * @param indirectReference The indirect reference or <code>null</code> if not set. * @param dataValueDescriptor The data value descriptor or <code>null</code> if not set. * @param externalData The external data in its encoded form. */ public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, Asn1Object dataValueDescriptor, DerTaggedObject externalData) : this(directReference, indirectReference, dataValueDescriptor, externalData.TagNo, externalData.ToAsn1Object()) { }