本文整理汇总了C#中Org.BouncyCastle.Asn1.Asn1Object类的典型用法代码示例。如果您正苦于以下问题:C# Asn1Object类的具体用法?C# Asn1Object怎么用?C# Asn1Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Asn1Object类属于Org.BouncyCastle.Asn1命名空间,在下文中一共展示了Asn1Object类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EncryptionScheme
internal EncryptionScheme(
Asn1Sequence seq)
: base(seq)
{
objectID = (Asn1Object) seq[0];
obj = (Asn1Object) seq[1];
}
示例2: SafeBag
public SafeBag(
DerObjectIdentifier oid,
Asn1Object obj)
{
this.bagID = oid;
this.bagValue = obj;
this.bagAttributes = null;
}
示例3: DerExternal
/**
* Creates a new instance of DerExternal.
* See X.690 for more informations about the meaning of these parameters
* @param directReference The direct reference or <code>null</code> if not set.
* @param indirectReference The indirect reference or <code>null</code> if not set.
* @param dataValueDescriptor The data value descriptor or <code>null</code> if not set.
* @param encoding The encoding to be used for the external data
* @param externalData The external data
*/
public DerExternal(DerObjectIdentifier directReference, DerInteger indirectReference, Asn1Object dataValueDescriptor, int encoding, Asn1Object externalData)
{
DirectReference = directReference;
IndirectReference = indirectReference;
DataValueDescriptor = dataValueDescriptor;
Encoding = encoding;
ExternalContent = externalData.ToAsn1Object();
}
示例4: IsConstructed
internal static bool IsConstructed(bool isExplicit, Asn1Object obj)
{
if (isExplicit || obj is Asn1Sequence || obj is Asn1Set)
return true;
Asn1TaggedObject tagged = obj as Asn1TaggedObject;
if (tagged == null)
return false;
return IsConstructed(tagged.IsExplicit(), tagged.GetObject());
}
示例5: Asn1Equals
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
DerGeneralString other = asn1Object as DerGeneralString;
if (other == null)
return false;
return this.str.Equals(other.str);
}
示例6: SmimeCapability
public SmimeCapability(
Asn1Sequence seq)
{
capabilityID = (DerObjectIdentifier) seq[0].ToAsn1Object();
if (seq.Count > 1)
{
parameters = seq[1].ToAsn1Object();
}
}
示例7: ServiceLocator
private ServiceLocator(
Asn1Sequence seq)
{
this.issuer = X509Name.GetInstance(seq[0]);
if (seq.Count > 1)
{
this.locator = seq[1].ToAsn1Object();
}
}
示例8: Asn1Equals
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
DerEnumerated other = asn1Object as DerEnumerated;
if (other == null)
return false;
return Arrays.AreEqual(this.bytes, other.bytes);
}
示例9: Time
public Time(
Asn1Object time)
{
if (!(time is DerUtcTime)
&& !(time is DerGeneralizedTime))
{
throw new ArgumentException("unknown object passed to Time");
}
this.time = time;
}
示例10: Asn1Equals
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
DerApplicationSpecific other = asn1Object as DerApplicationSpecific;
if (other == null)
return false;
return this.tag == other.tag
&& Arrays.AreEqual(this.octets, other.octets);
}
示例11: Asn1Equals
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
DerUnknownTag other = asn1Object as DerUnknownTag;
if (other == null)
return false;
return this.tag == other.tag
&& Arrays.AreEqual(this.data, other.data);
}
示例12: Asn1Equals
protected override bool Asn1Equals(
Asn1Object asn1Object)
{
Asn1TaggedObject other = asn1Object as Asn1TaggedObject;
if (other == null)
return false;
return this.tagNo == other.tagNo
// && this.empty == other.empty
&& this.explicitly == other.explicitly // TODO Should this be part of equality?
&& Platform.Equals(GetObject(), other.GetObject());
}
示例13: CommitmentTypeQualifier
/**
* Creates a new <code>CommitmentTypeQualifier</code> instance.
*
* @param commitmentTypeIdentifier a <code>CommitmentTypeIdentifier</code> value
* @param qualifier the qualifier, defined by the above field.
*/
public CommitmentTypeQualifier(
DerObjectIdentifier commitmentTypeIdentifier,
Asn1Encodable qualifier)
{
if (commitmentTypeIdentifier == null)
throw new ArgumentNullException("commitmentTypeIdentifier");
this.commitmentTypeIdentifier = commitmentTypeIdentifier;
if (qualifier != null)
{
this.qualifier = qualifier.ToAsn1Object();
}
}
示例14: DerExternal
public DerExternal(
Asn1EncodableVector vector)
{
int offset = 0;
Asn1Object enc = GetObjFromVector(vector, offset);
if (enc is DerObjectIdentifier)
{
directReference = (DerObjectIdentifier)enc;
offset++;
enc = GetObjFromVector(vector, offset);
}
if (enc is DerInteger)
{
indirectReference = (DerInteger) enc;
offset++;
enc = GetObjFromVector(vector, offset);
}
if (!(enc is DerTaggedObject))
{
dataValueDescriptor = (Asn1Object) enc;
offset++;
enc = GetObjFromVector(vector, offset);
}
if (!(enc is DerTaggedObject))
{
throw new InvalidOperationException(
"No tagged object found in vector. Structure doesn't seem to be of type External");
}
if (vector.Count != offset + 1)
throw new ArgumentException("input vector too large", "vector");
if (!(enc is DerTaggedObject))
throw new ArgumentException("No tagged object found in vector. Structure doesn't seem to be of type External", "vector");
DerTaggedObject obj = (DerTaggedObject)enc;
// Use property accessor to include check on value
Encoding = obj.TagNo;
if (encoding < 0 || encoding > 2)
throw new InvalidOperationException("invalid encoding value");
externalContent = obj.GetObject();
}
示例15: SignerIdentifier
public SignerIdentifier(
Asn1Object id)
{
this.id = id;
}