本文整理汇总了C#中Asn1OctetString类的典型用法代码示例。如果您正苦于以下问题:C# Asn1OctetString类的具体用法?C# Asn1OctetString怎么用?C# Asn1OctetString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Asn1OctetString类属于命名空间,在下文中一共展示了Asn1OctetString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KeySpecificInfo
public KeySpecificInfo(
DerObjectIdentifier algorithm,
Asn1OctetString counter)
{
this.algorithm = algorithm;
this.counter = counter;
}
示例2: KekIdentifier
public KekIdentifier(
Asn1Sequence seq)
{
keyIdentifier = (Asn1OctetString) seq[0];
switch (seq.Count)
{
case 1:
break;
case 2:
if (seq[1] is DerGeneralizedTime)
{
date = (DerGeneralizedTime) seq[1];
}
else
{
other = OtherKeyAttribute.GetInstance(seq[2]);
}
break;
case 3:
date = (DerGeneralizedTime) seq[1];
other = OtherKeyAttribute.GetInstance(seq[2]);
break;
default:
throw new ArgumentException("Invalid KekIdentifier");
}
}
示例3: 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]);
}
示例4: PbmParameter
private PbmParameter(Asn1Sequence seq)
{
salt = Asn1OctetString.GetInstance(seq[0]);
owf = AlgorithmIdentifier.GetInstance(seq[1]);
iterationCount = DerInteger.GetInstance(seq[2]);
mac = AlgorithmIdentifier.GetInstance(seq[3]);
}
示例5: CertResponse
private CertResponse(Asn1Sequence seq)
{
certReqId = DerInteger.GetInstance(seq[0]);
status = PkiStatusInfo.GetInstance(seq[1]);
if (seq.Count >= 3)
{
if (seq.Count == 3)
{
Asn1Encodable o = seq[2];
if (o is Asn1OctetString)
{
rspInfo = Asn1OctetString.GetInstance(o);
}
else
{
certifiedKeyPair = CertifiedKeyPair.GetInstance(o);
}
}
else
{
certifiedKeyPair = CertifiedKeyPair.GetInstance(seq[2]);
rspInfo = Asn1OctetString.GetInstance(seq[3]);
}
}
}
示例6: AuthenticatedData
public AuthenticatedData(
OriginatorInfo originatorInfo,
Asn1Set recipientInfos,
AlgorithmIdentifier macAlgorithm,
AlgorithmIdentifier digestAlgorithm,
ContentInfo encapsulatedContent,
Asn1Set authAttrs,
Asn1OctetString mac,
Asn1Set unauthAttrs)
{
if (digestAlgorithm != null || authAttrs != null)
{
if (digestAlgorithm == null || authAttrs == null)
{
throw new ArgumentException("digestAlgorithm and authAttrs must be set together");
}
}
version = new DerInteger(CalculateVersion(originatorInfo));
this.originatorInfo = originatorInfo;
this.macAlgorithm = macAlgorithm;
this.digestAlgorithm = digestAlgorithm;
this.recipientInfos = recipientInfos;
this.encapsulatedContentInfo = encapsulatedContent;
this.authAttrs = authAttrs;
this.mac = mac;
this.unauthAttrs = unauthAttrs;
}
示例7: Pbkdf2Params
public Pbkdf2Params(
Asn1Sequence seq)
{
if (seq.Count < 2 || seq.Count > 4)
throw new ArgumentException("Wrong number of elements in sequence", "seq");
this.octStr = (Asn1OctetString)seq[0];
this.iterationCount = (DerInteger)seq[1];
Asn1Encodable kl = null, d = null;
if (seq.Count > 3)
{
kl = seq[2];
d = seq[3];
}
else if (seq.Count > 2)
{
if (seq[2] is DerInteger)
{
kl = seq[2];
}
else
{
d = seq[2];
}
}
if (kl != null)
{
keyLength = (DerInteger)kl;
}
if (d != null)
{
prf = AlgorithmIdentifier.GetInstance(d);
}
}
示例8: RecipientEncryptedKey
public RecipientEncryptedKey(
KeyAgreeRecipientIdentifier id,
Asn1OctetString encryptedKey)
{
this.identifier = id;
this.encryptedKey = encryptedKey;
}
示例9: X509Extension
public X509Extension(
bool critical,
Asn1OctetString value)
{
this.critical = critical;
this.value = value;
}
示例10: AuthEnvelopedData
public AuthEnvelopedData(
OriginatorInfo originatorInfo,
Asn1Set recipientInfos,
EncryptedContentInfo authEncryptedContentInfo,
Asn1Set authAttrs,
Asn1OctetString mac,
Asn1Set unauthAttrs)
{
// "It MUST be set to 0."
this.version = new DerInteger(0);
this.originatorInfo = originatorInfo;
// TODO
// "There MUST be at least one element in the collection."
this.recipientInfos = recipientInfos;
this.authEncryptedContentInfo = authEncryptedContentInfo;
// TODO
// "The authAttrs MUST be present if the content type carried in
// EncryptedContentInfo is not id-data."
this.authAttrs = authAttrs;
this.mac = mac;
this.unauthAttrs = unauthAttrs;
}
示例11: OtherHash
public OtherHash(
Asn1OctetString sha1Hash)
{
if (sha1Hash == null)
throw new ArgumentNullException("sha1Hash");
this.sha1Hash = sha1Hash;
}
示例12: KekRecipientInfo
public KekRecipientInfo(
Asn1Sequence seq)
{
version = (DerInteger) seq[0];
kekID = KekIdentifier.GetInstance(seq[1]);
keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
encryptedKey = (Asn1OctetString) seq[3];
}
示例13: PbeParameter
private PbeParameter(Asn1Sequence seq)
{
if (seq.Count != 2)
throw new ArgumentException("Wrong number of elements in sequence", "seq");
salt = Asn1OctetString.GetInstance(seq[0]);
iterationCount = DerInteger.GetInstance(seq[1]);
}
示例14: KeyTransRecipientInfo
public KeyTransRecipientInfo(
Asn1Sequence seq)
{
this.version = (DerInteger) seq[0];
this.rid = RecipientIdentifier.GetInstance(seq[1]);
this.keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
this.encryptedKey = (Asn1OctetString) seq[3];
}
示例15: PasswordRecipientInfo
public PasswordRecipientInfo(
AlgorithmIdentifier keyEncryptionAlgorithm,
Asn1OctetString encryptedKey)
{
this.version = new DerInteger(0);
this.keyEncryptionAlgorithm = keyEncryptionAlgorithm;
this.encryptedKey = encryptedKey;
}