private static void WriteEncodable(MemoryStream ms, Asn1Encodable e) { if (e != null) { byte[] derEncoded = e.GetDerEncoded(); ms.Write(derEncoded, 0, derEncoded.Length); } }
public DerApplicationSpecific( int tag, Asn1Encodable obj) { this.tag = tag | Asn1Tags.Constructed; this.octets = obj.GetDerEncoded(); }
internal Asn1OctetString( Asn1Encodable obj) { try { this.str = obj.GetDerEncoded(); } catch (IOException e) { throw new ArgumentException("Error processing object : " + e.ToString()); } }
public DerApplicationSpecific( bool isExplicit, int tag, Asn1Encodable obj) { byte[] data = obj.GetDerEncoded(); this.isConstructed = isExplicit; this.tag = tag; if (isExplicit) { this.octets = data; } else { int lenBytes = GetLengthOfLength(data); byte[] tmp = new byte[data.Length - lenBytes]; Array.Copy(data, lenBytes, tmp, 0, tmp.Length); this.octets = tmp; } }
public DerBitString( Asn1Encodable obj) { this.data = obj.GetDerEncoded(); //this.padBits = 0; }
internal static byte[] GetSignatureForObject( DerObjectIdentifier sigOid, // TODO Redundant now? string sigName, AsymmetricKeyParameter privateKey, SecureRandom random, Asn1Encodable ae) { if (sigOid == null) throw new ArgumentNullException("sigOid"); ISigner sig = SignerUtilities.GetSigner(sigName); if (random != null) { sig.Init(true, new ParametersWithRandom(privateKey, random)); } else { sig.Init(true, privateKey); } byte[] encoded = ae.GetDerEncoded(); sig.BlockUpdate(encoded, 0, encoded.Length); return sig.GenerateSignature(); }
public DerBitString( Asn1Encodable obj) { this.data = obj.GetDerEncoded(); // this.padBits = 0; }
public DerBitString( Asn1Encodable obj) : this(obj.GetDerEncoded()) { }
private static void WriteEncodable(MemoryStream ms, Asn1Encodable e) { if (e != null) { byte[] bs = e.GetDerEncoded(); ms.Write(bs, 0, bs.Length); } }
public DerBitString(Asn1Encodable obj) { data = obj.GetDerEncoded(); }