本文整理汇总了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())
{
}