本文整理汇总了C#中DerBitString类的典型用法代码示例。如果您正苦于以下问题:C# DerBitString类的具体用法?C# DerBitString怎么用?C# DerBitString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DerBitString类属于命名空间,在下文中一共展示了DerBitString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PkiStatusInfo
public PkiStatusInfo(
Asn1Sequence seq)
{
this.status = DerInteger.GetInstance(seq[0]);
this.statusString = null;
this.failInfo = null;
if (seq.Count > 2)
{
this.statusString = PkiFreeText.GetInstance(seq[1]);
this.failInfo = DerBitString.GetInstance(seq[2]);
}
else if (seq.Count > 1)
{
object obj = seq[1];
if (obj is DerBitString)
{
this.failInfo = DerBitString.GetInstance(obj);
}
else
{
this.statusString = PkiFreeText.GetInstance(obj);
}
}
}
示例2: PkiMessage
public PkiMessage(
PkiHeader header,
PkiBody body,
DerBitString protection)
: this(header, body, protection, null)
{
}
示例3: SubjectPublicKeyInfo
public SubjectPublicKeyInfo(
AlgorithmIdentifier algID,
Asn1Encodable publicKey)
{
this.keyData = new DerBitString(publicKey);
this.algID = algID;
}
示例4: EncryptedValue
private EncryptedValue(Asn1Sequence seq)
{
int index = 0;
while (seq[index] is Asn1TaggedObject)
{
Asn1TaggedObject tObj = (Asn1TaggedObject)seq[index];
switch (tObj.TagNo)
{
case 0:
intendedAlg = AlgorithmIdentifier.GetInstance(tObj, false);
break;
case 1:
symmAlg = AlgorithmIdentifier.GetInstance(tObj, false);
break;
case 2:
encSymmKey = DerBitString.GetInstance(tObj, false);
break;
case 3:
keyAlg = AlgorithmIdentifier.GetInstance(tObj, false);
break;
case 4:
valueHint = Asn1OctetString.GetInstance(tObj, false);
break;
}
++index;
}
encValue = DerBitString.GetInstance(seq[index]);
}
示例5: OriginatorPublicKey
public OriginatorPublicKey(
AlgorithmIdentifier algorithm,
byte[] publicKey)
{
this.mAlgorithm = algorithm;
this.mPublicKey = new DerBitString(publicKey);
}
示例6: 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]);
}
}
}
示例7: PKMacValue
/**
* Creates a new PKMACValue.
* @param aid CMPObjectIdentifiers.passwordBasedMAC, with PBMParameter
* @param value MAC of the DER-encoded SubjectPublicKeyInfo
*/
public PKMacValue(
AlgorithmIdentifier algID,
DerBitString macValue)
{
this.algID = algID;
this.macValue = macValue;
}
示例8: DHValidationParms
private DHValidationParms(Asn1Sequence seq)
{
if (seq.Count != 2)
throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
this.seed = DerBitString.GetInstance(seq[0]);
this.pgenCounter = DerInteger.GetInstance(seq[1]);
}
示例9: CertificationRequest
public CertificationRequest(
CertificationRequestInfo requestInfo,
AlgorithmIdentifier algorithm,
DerBitString signature)
{
this.reqInfo = requestInfo;
this.sigAlgId = algorithm;
this.sigBits = signature;
}
示例10: PopoSigningKey
/**
* Creates a new Proof of Possession object for a signing key.
* @param poposkIn the PopoSigningKeyInput structure, or null if the
* CertTemplate includes both subject and publicKey values.
* @param aid the AlgorithmIdentifier used to sign the proof of possession.
* @param signature a signature over the DER-encoded value of poposkIn,
* or the DER-encoded value of certReq if poposkIn is null.
*/
public PopoSigningKey(
PopoSigningKeyInput poposkIn,
AlgorithmIdentifier aid,
DerBitString signature)
{
this.poposkInput = poposkIn;
this.algorithmIdentifier = aid;
this.signature = signature;
}
示例11: Signature
private Signature(
Asn1Sequence seq)
{
signatureAlgorithm = AlgorithmIdentifier.GetInstance(seq[0]);
signatureValue = (DerBitString)seq[1];
if (seq.Count == 3)
{
certs = Asn1Sequence.GetInstance(
(Asn1TaggedObject)seq[2], true);
}
}
示例12: X509CertificateStructure
private X509CertificateStructure(
Asn1Sequence seq)
{
if (seq.Count != 3)
throw new ArgumentException("sequence wrong size for a certificate", "seq");
//
// correct x509 certficate
//
tbsCert = TbsCertificateStructure.GetInstance(seq[0]);
sigAlgID = AlgorithmIdentifier.GetInstance(seq[1]);
sig = DerBitString.GetInstance(seq[2]);
}
示例13: DoTestZeroLengthStrings
private void DoTestZeroLengthStrings()
{
// basic construction
DerBitString s1 = new DerBitString(new byte[0], 0);
// check GetBytes()
s1.GetBytes();
// check encoding/decoding
DerBitString derBit = (DerBitString)Asn1Object.FromByteArray(s1.GetEncoded());
if (!Arrays.AreEqual(s1.GetEncoded(), Hex.Decode("030100")))
{
Fail("zero encoding wrong");
}
try
{
new DerBitString(null, 1);
Fail("exception not thrown");
}
catch (ArgumentNullException)
{
}
try
{
new DerBitString(new byte[0], 1);
Fail("exception not thrown");
}
catch (ArgumentException)
{
}
try
{
new DerBitString(new byte[1], 8);
Fail("exception not thrown");
}
catch (ArgumentException)
{
}
DerBitString s2 = new DerBitString(0);
if (!Arrays.AreEqual(s1.GetEncoded(), s2.GetEncoded()))
{
Fail("zero encoding wrong");
}
}
示例14: IssuerSerial
private IssuerSerial(
Asn1Sequence seq)
{
if (seq.Count != 2 && seq.Count != 3)
{
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
issuer = GeneralNames.GetInstance(seq[0]);
serial = DerInteger.GetInstance(seq[1]);
if (seq.Count == 3)
{
issuerUid = DerBitString.GetInstance(seq[2]);
}
}
示例15: ObjectDigestInfo
/**
* Constructor from given details.
* <p>
* If <code>digestedObjectType</code> is not {@link #publicKeyCert} or
* {@link #publicKey} <code>otherObjectTypeID</code> must be given,
* otherwise it is ignored.</p>
*
* @param digestedObjectType The digest object type.
* @param otherObjectTypeID The object type ID for
* <code>otherObjectDigest</code>.
* @param digestAlgorithm The algorithm identifier for the hash.
* @param objectDigest The hash value.
*/
public ObjectDigestInfo(
int digestedObjectType,
string otherObjectTypeID,
AlgorithmIdentifier digestAlgorithm,
byte[] objectDigest)
{
this.digestedObjectType = new DerEnumerated(digestedObjectType);
if (digestedObjectType == OtherObjectDigest)
{
this.otherObjectTypeID = new DerObjectIdentifier(otherObjectTypeID);
}
this.digestAlgorithm = digestAlgorithm;
this.objectDigest = new DerBitString(objectDigest);
}