本文整理汇总了C#中Asn1TaggedObject类的典型用法代码示例。如果您正苦于以下问题:C# Asn1TaggedObject类的具体用法?C# Asn1TaggedObject怎么用?C# Asn1TaggedObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Asn1TaggedObject类属于命名空间,在下文中一共展示了Asn1TaggedObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopoPrivKey
private PopoPrivKey(Asn1TaggedObject obj)
{
this.tagNo = obj.TagNo;
switch (tagNo)
{
case thisMessage:
this.obj = DerBitString.GetInstance(obj, false);
break;
case subsequentMessage:
this.obj = SubsequentMessage.ValueOf(DerInteger.GetInstance(obj, false).Value.IntValue);
break;
case dhMAC:
this.obj = DerBitString.GetInstance(obj, false);
break;
case agreeMAC:
this.obj = PKMacValue.GetInstance(obj, false);
break;
case encryptedKey:
this.obj = EnvelopedData.GetInstance(obj, false);
break;
default:
throw new ArgumentException("unknown tag in PopoPrivKey", "obj");
}
}
示例2: Evidence
private Evidence(Asn1TaggedObject tagged)
{
if (tagged.TagNo == 0)
{
this.tstEvidence = TimeStampTokenEvidence.GetInstance(tagged, false);
}
}
示例3: DeclarationOfMajority
private DeclarationOfMajority(
Asn1TaggedObject o)
{
if (o.TagNo > 2)
throw new ArgumentException("Bad tag number: " + o.TagNo);
this.declaration = o;
}
示例4: GetInstance
public static RequestedCertificate GetInstance(
Asn1TaggedObject obj,
bool isExplicit)
{
if (!isExplicit)
throw new ArgumentException("choice item must be explicitly tagged");
return GetInstance(obj.GetObject());
}
示例5: GetInstance
public static DirectoryString GetInstance(
Asn1TaggedObject obj,
bool isExplicit)
{
if (!isExplicit)
throw new ArgumentException("choice item must be explicitly tagged");
return GetInstance(obj.GetObject());
}
示例6: GetInstance
/**
* return an OriginatorIdentifierOrKey object from a tagged object.
*
* @param o the tagged object holding the object we want.
* @param explicitly true if the object is meant to be explicitly
* tagged false otherwise.
* @exception ArgumentException if the object held by the
* tagged object cannot be converted.
*/
public static OriginatorIdentifierOrKey GetInstance(
Asn1TaggedObject o,
bool explicitly)
{
if (!explicitly)
{
throw new ArgumentException(
"Can't implicitly tag OriginatorIdentifierOrKey");
}
return GetInstance(o.GetObject());
}
示例7: DistributionPointName
public DistributionPointName(
Asn1TaggedObject obj)
{
this.type = obj.TagNo;
if (type == FullName)
{
this.name = GeneralNames.GetInstance(obj, false);
}
else
{
this.name = Asn1Set.GetInstance(obj, false);
}
}
示例8: RequestedCertificate
private RequestedCertificate(
Asn1TaggedObject tagged)
{
switch ((Choice) tagged.TagNo)
{
case Choice.AttributeCertificate:
this.attributeCert = Asn1OctetString.GetInstance(tagged, true).GetOctets();
break;
case Choice.PublicKeyCertificate:
this.publicKeyCert = Asn1OctetString.GetInstance(tagged, true).GetOctets();
break;
default:
throw new ArgumentException("unknown tag number: " + tagged.TagNo);
}
}
示例9: Target
/**
* Constructor from Asn1TaggedObject.
*
* @param tagObj The tagged object.
* @throws ArgumentException if the encoding is wrong.
*/
private Target(
Asn1TaggedObject tagObj)
{
switch ((Choice) tagObj.TagNo)
{
case Choice.Name: // GeneralName is already a choice so explicit
targetName = GeneralName.GetInstance(tagObj, true);
break;
case Choice.Group:
targetGroup = GeneralName.GetInstance(tagObj, true);
break;
default:
throw new ArgumentException("unknown tag: " + tagObj.TagNo);
}
}
示例10: CertOrEncCert
private CertOrEncCert(Asn1TaggedObject tagged)
{
if (tagged.TagNo == 0)
{
certificate = CmpCertificate.GetInstance(tagged.GetObject());
}
else if (tagged.TagNo == 1)
{
encryptedCert = EncryptedValue.GetInstance(tagged.GetObject());
}
else
{
throw new ArgumentException("unknown tag: " + tagged.TagNo, "tagged");
}
}
示例11: CertStatus
public CertStatus(
Asn1TaggedObject choice)
{
this.tagNo = choice.TagNo;
switch (choice.TagNo)
{
case 1:
value = RevokedInfo.GetInstance(choice, false);
break;
case 0:
case 2:
value = DerNull.Instance;
break;
}
}
示例12: Holder
/**
* Constructor for a holder for an v1 attribute certificate.
*
* @param tagObj The ASN.1 tagged holder object.
*/
public Holder(
Asn1TaggedObject tagObj)
{
switch (tagObj.TagNo)
{
case 0:
baseCertificateID = IssuerSerial.GetInstance(tagObj, false);
break;
case 1:
entityName = GeneralNames.GetInstance(tagObj, false);
break;
default:
throw new ArgumentException("unknown tag in Holder");
}
this.version = 0;
}
示例13: PkiArchiveOptions
private PkiArchiveOptions(Asn1TaggedObject tagged)
{
switch (tagged.TagNo)
{
case encryptedPrivKey:
value = EncryptedKey.GetInstance(tagged.GetObject());
break;
case keyGenParameters:
value = Asn1OctetString.GetInstance(tagged, false);
break;
case archiveRemGenPrivKey:
value = DerBoolean.GetInstance(tagged, false);
break;
default:
throw new ArgumentException("unknown tag number: " + tagged.TagNo, "tagged");
}
}
示例14: CertStatus
public CertStatus(
Asn1TaggedObject choice)
{
this.tagNo = choice.TagNo;
switch (choice.TagNo)
{
case 1:
value = RevokedInfo.GetInstance(choice, false);
break;
case 0:
case 2:
value = DerNull.Instance;
break;
default:
throw new ArgumentException("Unknown tag encountered: " + choice.TagNo);
}
}
示例15: ProofOfPossession
private ProofOfPossession(Asn1TaggedObject tagged)
{
tagNo = tagged.TagNo;
switch (tagNo)
{
case 0:
obj = DerNull.Instance;
break;
case 1:
obj = PopoSigningKey.GetInstance(tagged, false);
break;
case 2:
case 3:
obj = PopoPrivKey.GetInstance(tagged, false);
break;
default:
throw new ArgumentException("unknown tag: " + tagNo, "tagged");
}
}