本文整理汇总了C#中Org.BouncyCastle.Asn1.X509.X509Extensions类的典型用法代码示例。如果您正苦于以下问题:C# X509Extensions类的具体用法?C# X509Extensions怎么用?C# X509Extensions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
X509Extensions类属于Org.BouncyCastle.Asn1.X509命名空间,在下文中一共展示了X509Extensions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SingleResponse
public SingleResponse(
Asn1Sequence seq)
{
this.certID = CertID.GetInstance(seq[0]);
this.certStatus = CertStatus.GetInstance(seq[1]);
this.thisUpdate = (DerGeneralizedTime)seq[2];
if (seq.Count > 4)
{
this.nextUpdate = DerGeneralizedTime.GetInstance(
(Asn1TaggedObject) seq[3], true);
this.singleExtensions = X509Extensions.GetInstance(
(Asn1TaggedObject) seq[4], true);
}
else if (seq.Count > 3)
{
Asn1TaggedObject o = (Asn1TaggedObject) seq[3];
if (o.TagNo == 0)
{
this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
}
else
{
this.singleExtensions = X509Extensions.GetInstance(o, true);
}
}
}
示例2: AttributeCertificateInfo
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]);
}
}
}
示例3: Generate
public TimeStampRequest Generate(
string digestAlgorithmOid,
byte[] digest,
IBigInteger nonce)
{
if (digestAlgorithmOid == null)
{
throw new ArgumentException("No digest algorithm specified");
}
DerObjectIdentifier digestAlgOid = new DerObjectIdentifier(digestAlgorithmOid);
AlgorithmIdentifier algID = new AlgorithmIdentifier(digestAlgOid, DerNull.Instance);
MessageImprint messageImprint = new MessageImprint(algID, digest);
X509Extensions ext = null;
if (extOrdering.Count != 0)
{
ext = new X509Extensions(extOrdering, extensions);
}
DerInteger derNonce = nonce == null
? null
: new DerInteger(nonce);
return new TimeStampRequest(
new TimeStampReq(messageImprint, reqPolicy, derNonce, certReq, ext));
}
示例4: RequestObject
public RequestObject(
CertificateID certId,
X509Extensions extensions)
{
this.certId = certId;
this.extensions = extensions;
}
示例5: ResponseObject
private ResponseObject(
CertificateID certId,
CertificateStatus certStatus,
DerGeneralizedTime thisUpdate,
DerGeneralizedTime nextUpdate,
X509Extensions extensions)
{
this.certId = certId;
if (certStatus == null)
{
this.certStatus = new CertStatus();
}
else if (certStatus is UnknownStatus)
{
this.certStatus = new CertStatus(2, DerNull.Instance);
}
else
{
RevokedStatus rs = (RevokedStatus) certStatus;
CrlReason revocationReason = rs.HasRevocationReason
? new CrlReason(rs.RevocationReason)
: null;
this.certStatus = new CertStatus(
new RevokedInfo(new DerGeneralizedTime(rs.RevocationTime), revocationReason));
}
this.thisUpdate = thisUpdate;
this.nextUpdate = nextUpdate;
this.extensions = extensions;
}
示例6: RevDetails
private RevDetails(Asn1Sequence seq)
{
certDetails = CertTemplate.GetInstance(seq[0]);
crlEntryDetails = seq.Count <= 1
? null
: X509Extensions.GetInstance(seq[1]);
}
示例7: ResponseData
public ResponseData(
ResponderID responderID,
DerGeneralizedTime producedAt,
Asn1Sequence responses,
X509Extensions responseExtensions)
: this(V1, responderID, producedAt, responses, responseExtensions)
{
}
示例8: RevDetails
private RevDetails(Asn1Sequence seq)
{
certDetails = CertTemplate.GetInstance(seq[0]);
if (seq.Count > 1)
{
crlEntryDetails = X509Extensions.GetInstance(seq[1]);
}
}
示例9: Request
public Request(
CertID reqCert,
X509Extensions singleRequestExtensions)
{
if (reqCert == null)
throw new ArgumentNullException("reqCert");
this.reqCert = reqCert;
this.singleRequestExtensions = singleRequestExtensions;
}
示例10: TbsRequest
public TbsRequest(
GeneralName requestorName,
Asn1Sequence requestList,
X509Extensions requestExtensions)
{
this.version = V1;
this.requestorName = requestorName;
this.requestList = requestList;
this.requestExtensions = requestExtensions;
}
示例11: Request
private Request(
Asn1Sequence seq)
{
reqCert = CertID.GetInstance(seq[0]);
if (seq.Count == 2)
{
singleRequestExtensions = X509Extensions.GetInstance(
(Asn1TaggedObject)seq[1], true);
}
}
示例12: RevAnnContent
private RevAnnContent(Asn1Sequence seq)
{
status = PkiStatusEncodable.GetInstance(seq[0]);
certId = CertId.GetInstance(seq[1]);
willBeRevokedAt = DerGeneralizedTime.GetInstance(seq[2]);
badSinceDate = DerGeneralizedTime.GetInstance(seq[3]);
if (seq.Count > 4)
{
crlDetails = X509Extensions.GetInstance(seq[4]);
}
}
示例13: TimeStampReq
public TimeStampReq(
MessageImprint messageImprint,
DerObjectIdentifier tsaPolicy,
DerInteger nonce,
DerBoolean certReq,
X509Extensions extensions)
{
// default
this.version = new DerInteger(1);
this.messageImprint = messageImprint;
this.tsaPolicy = tsaPolicy;
this.nonce = nonce;
this.certReq = certReq;
this.extensions = extensions;
}
示例14: CrlEntry
public CrlEntry(
Asn1Sequence seq)
{
if (seq.Count < 2 || seq.Count > 3)
{
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
this.seq = seq;
userCertificate = DerInteger.GetInstance(seq[0]);
revocationDate = Time.GetInstance(seq[1]);
if (seq.Count == 3)
{
crlEntryExtensions = X509Extensions.GetInstance(seq[2]);
}
}
示例15: CertTemplate
private CertTemplate(Asn1Sequence seq)
{
this.seq = seq;
foreach (Asn1TaggedObject tObj in seq)
{
switch (tObj.TagNo)
{
case 0:
version = DerInteger.GetInstance(tObj, false);
break;
case 1:
serialNumber = DerInteger.GetInstance(tObj, false);
break;
case 2:
signingAlg = AlgorithmIdentifier.GetInstance(tObj, false);
break;
case 3:
issuer = X509Name.GetInstance(tObj, true); // CHOICE
break;
case 4:
validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(tObj, false));
break;
case 5:
subject = X509Name.GetInstance(tObj, true); // CHOICE
break;
case 6:
publicKey = SubjectPublicKeyInfo.GetInstance(tObj, false);
break;
case 7:
issuerUID = DerBitString.GetInstance(tObj, false);
break;
case 8:
subjectUID = DerBitString.GetInstance(tObj, false);
break;
case 9:
extensions = X509Extensions.GetInstance(tObj, false);
break;
default:
throw new ArgumentException("unknown tag: " + tObj.TagNo, "seq");
}
}
}