本文整理汇总了C#中DerInteger类的典型用法代码示例。如果您正苦于以下问题:C# DerInteger类的具体用法?C# DerInteger怎么用?C# DerInteger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DerInteger类属于命名空间,在下文中一共展示了DerInteger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: IssuerAndSerialNumber
public IssuerAndSerialNumber(
X509Name name,
BigInteger certSerialNumber)
{
this.name = name;
this.certSerialNumber = new DerInteger(certSerialNumber);
}
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:7,代码来源:IssuerAndSerialNumber.cs
示例2: RsassaPssParameters
public RsassaPssParameters(
Asn1Sequence seq)
{
hashAlgorithm = DefaultHashAlgorithm;
maskGenAlgorithm = DefaultMaskGenFunction;
saltLength = DefaultSaltLength;
trailerField = DefaultTrailerField;
for (int i = 0; i != seq.Count; i++)
{
Asn1TaggedObject o = (Asn1TaggedObject)seq[i];
switch (o.TagNo)
{
case 0:
hashAlgorithm = AlgorithmIdentifier.GetInstance(o, true);
break;
case 1:
maskGenAlgorithm = AlgorithmIdentifier.GetInstance(o, true);
break;
case 2:
saltLength = DerInteger.GetInstance(o, true);
break;
case 3:
trailerField = DerInteger.GetInstance(o, true);
break;
default:
throw new ArgumentException("unknown tag");
}
}
}
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:31,代码来源:RSASSAPSSparams.cs
示例3: RC2CbcParameter
public RC2CbcParameter(
int parameterVersion,
byte[] iv)
{
this.version = new DerInteger(parameterVersion);
this.iv = new DerOctetString(iv);
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:RC2CBCParameter.cs
示例4: Pkcs12PbeParams
public Pkcs12PbeParams(
byte[] salt,
int iterations)
{
this.iv = new DerOctetString(salt);
this.iterations = new DerInteger(iterations);
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:PKCS12PBEParams.cs
示例5: 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);
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:35,代码来源:PBKDF2Params.cs
示例6: ConvertVector
private static Asn1EncodableVector ConvertVector(IList numbers)
{
Asn1EncodableVector av = new Asn1EncodableVector();
foreach (object o in numbers)
{
DerInteger di;
if (o is BigInteger)
{
di = new DerInteger((BigInteger)o);
}
else if (o is int)
{
di = new DerInteger((int)o);
}
else
{
throw new ArgumentException();
}
av.Add(di);
}
return av;
}
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:25,代码来源:NoticeReference.cs
示例7: CompressedData
public CompressedData(
Asn1Sequence seq)
{
this.version = (DerInteger) seq[0];
this.compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
this.encapContentInfo = ContentInfo.GetInstance(seq[2]);
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:CompressedData.cs
示例8: 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]);
}
}
}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:26,代码来源:CertResponse.cs
示例9: PerformTest
public override void PerformTest()
{
DerInteger val = new DerInteger(9);
DerApplicationSpecific tagged = new DerApplicationSpecific(false, 3, val);
if (!AreEqual(impData, tagged.GetEncoded()))
{
Fail("implicit encoding failed");
}
DerInteger recVal = (DerInteger) tagged.GetObject(Asn1Tags.Integer);
if (!val.Equals(recVal))
{
Fail("implicit read back failed");
}
DerApplicationSpecific certObj = (DerApplicationSpecific)
Asn1Object.FromByteArray(certData);
if (!certObj.IsConstructed() || certObj.ApplicationTag != 33)
{
Fail("parsing of certificate data failed");
}
byte[] encoded = certObj.GetDerEncoded();
if (!Arrays.AreEqual(certData, encoded))
{
Console.WriteLine(Encoding.ASCII.GetString(certData, 0, certData.Length).Substring(0, 20));
Console.WriteLine(Encoding.ASCII.GetString(encoded, 0, encoded.Length).Substring(0, 20));
Fail("re-encoding of certificate data failed");
}
}
开发者ID:RecursosOnline,项目名称:c-sharp,代码行数:35,代码来源:DERApplicationSpecificTest.cs
示例10: 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;
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:29,代码来源:AuthenticatedData.cs
示例11: DHPublicKey
public DHPublicKey(DerInteger y)
{
if (y == null)
throw new ArgumentNullException("y");
this.y = y;
}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:7,代码来源:DHPublicKey.cs
示例12: IssuerSerial
public IssuerSerial(
GeneralNames issuer,
DerInteger serial)
{
this.issuer = issuer;
this.serial = serial;
}
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:7,代码来源:IssuerSerial.cs
示例13: PkiStatusInfo
/**
* @param status
* @param statusString
*/
public PkiStatusInfo(
int status,
PkiFreeText statusString)
{
this.status = new DerInteger(status);
this.statusString = statusString;
}
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:11,代码来源:PKIStatusInfo.cs
示例14: GeneralSubtree
private GeneralSubtree(
Asn1Sequence seq)
{
baseName = GeneralName.GetInstance(seq[0]);
switch (seq.Count)
{
case 1:
break;
case 2:
{
Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[1]);
switch (o.TagNo)
{
case 0:
minimum = DerInteger.GetInstance(o, false);
break;
case 1:
maximum = DerInteger.GetInstance(o, false);
break;
default:
throw new ArgumentException("Bad tag number: " + o.TagNo);
}
break;
}
case 3:
{
minimum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
maximum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
break;
}
default:
throw new ArgumentException("Bad sequence size: " + seq.Count);
}
}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:35,代码来源:GeneralSubtree.cs
示例15: TimeStampedDataParser
private TimeStampedDataParser(Asn1SequenceParser parser)
{
this.parser = parser;
this.version = DerInteger.GetInstance(parser.ReadObject());
Asn1Object obj = parser.ReadObject().ToAsn1Object();
if (obj is DerIA5String)
{
this.dataUri = DerIA5String.GetInstance(obj);
obj = parser.ReadObject().ToAsn1Object();
}
if (//obj is MetaData ||
obj is Asn1SequenceParser)
{
this.metaData = MetaData.GetInstance(obj.ToAsn1Object());
obj = parser.ReadObject().ToAsn1Object();
}
if (obj is Asn1OctetStringParser)
{
this.content = (Asn1OctetStringParser)obj;
}
}
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:25,代码来源:TimeStampedDataParser.cs
示例16: 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]);
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:PbmParameter.cs
示例17: Accuracy
public Accuracy(
DerInteger seconds,
DerInteger millis,
DerInteger micros)
{
//Verifications
if (millis != null
&& (millis.Value.IntValue < MinMillis
|| millis.Value.IntValue > MaxMillis))
{
throw new ArgumentException(
"Invalid millis field : not in (1..999)");
}
if (micros != null
&& (micros.Value.IntValue < MinMicros
|| micros.Value.IntValue > MaxMicros))
{
throw new ArgumentException(
"Invalid micros field : not in (1..999)");
}
this.seconds = seconds;
this.millis = millis;
this.micros = micros;
}
开发者ID:htlp,项目名称:itextsharp,代码行数:26,代码来源:Accuracy.cs
示例18: 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]);
}
}
}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:30,代码来源:AttributeCertificateInfo.cs
示例19: 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;
}
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:28,代码来源:AuthEnvelopedData.cs
示例20: Pbkdf2Params
public Pbkdf2Params(
byte[] salt,
int iterationCount)
{
this.octStr = new DerOctetString(salt);
this.iterationCount = new DerInteger(iterationCount);
}
开发者ID:kungfubozo,项目名称:Bouncy-Castle-WP8,代码行数:7,代码来源:PBKDF2Params.cs
注:本文中的DerInteger类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论