本文整理匯總了C#中Org.BouncyCastle.Asn1.Asn1Encodable.GetDerEncoded方法的典型用法代碼示例。如果您正苦於以下問題:C# Asn1Encodable.GetDerEncoded方法的具體用法?C# Asn1Encodable.GetDerEncoded怎麽用?C# Asn1Encodable.GetDerEncoded使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Org.BouncyCastle.Asn1.Asn1Encodable
的用法示例。
在下文中一共展示了Asn1Encodable.GetDerEncoded方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DerApplicationSpecific
public DerApplicationSpecific(
int tag,
Asn1Encodable obj)
{
this.tag = tag | Asn1Tags.Constructed;
this.octets = obj.GetDerEncoded();
}
示例2: Asn1OctetString
internal Asn1OctetString(
Asn1Encodable obj)
{
try
{
this.str = obj.GetDerEncoded();
}
catch (IOException e)
{
throw new ArgumentException("Error processing object : " + e.ToString());
}
}
示例3: DerApplicationSpecific
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;
}
}
示例4: GetSignatureForObject
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();
}
示例5: DerBitString
public DerBitString(
Asn1Encodable obj)
{
this.data = obj.GetDerEncoded();
// this.padBits = 0;
}
示例6: WriteEncodable
private static void WriteEncodable(MemoryStream ms, Asn1Encodable e)
{
if (e != null)
{
byte[] bs = e.GetDerEncoded();
ms.Write(bs, 0, bs.Length);
}
}
示例7: DerBitString
public DerBitString(
Asn1Encodable obj)
: this(obj.GetDerEncoded())
{
}