本文整理汇总了Java中org.bouncycastle.asn1.BERSequence类的典型用法代码示例。如果您正苦于以下问题:Java BERSequence类的具体用法?Java BERSequence怎么用?Java BERSequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BERSequence类属于org.bouncycastle.asn1包,在下文中一共展示了BERSequence类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toASN1Object
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SignedData ::= SEQUENCE {
* version Version,
* digestAlgorithms DigestAlgorithmIdentifiers,
* contentInfo ContentInfo,
* certificates
* [0] IMPLICIT ExtendedCertificatesAndCertificates
* OPTIONAL,
* crls
* [1] IMPLICIT CertificateRevocationLists OPTIONAL,
* signerInfos SignerInfos }
* </pre>
*/
public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(digestAlgorithms);
v.add(contentInfo);
if (certificates != null)
{
v.add(new DERTaggedObject(false, 0, certificates));
}
if (crls != null)
{
v.add(new DERTaggedObject(false, 1, crls));
}
v.add(signerInfos);
return new BERSequence(v);
}
示例2: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SignedData ::= SEQUENCE {
* version Version,
* digestAlgorithms DigestAlgorithmIdentifiers,
* contentInfo ContentInfo,
* certificates
* [0] IMPLICIT ExtendedCertificatesAndCertificates
* OPTIONAL,
* crls
* [1] IMPLICIT CertificateRevocationLists OPTIONAL,
* signerInfos SignerInfos }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(digestAlgorithms);
v.add(contentInfo);
if (certificates != null)
{
v.add(new DERTaggedObject(false, 0, certificates));
}
if (crls != null)
{
v.add(new DERTaggedObject(false, 1, crls));
}
v.add(signerInfos);
return new BERSequence(v);
}
示例3: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
for (int i = 0; i != info.length; i++)
{
v.add(info[i]);
}
if (isBer)
{
return new BERSequence(v);
}
else
{
return new DLSequence(v);
}
}
示例4: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* ContentInfo ::= SEQUENCE {
* contentType ContentType,
* content
* [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
if (content != null)
{
v.add(new BERTaggedObject(true, 0, content));
}
if (isBer)
{
return new BERSequence(v);
}
else
{
return new DLSequence(v);
}
}
示例5: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* EnvelopedData ::= SEQUENCE {
* version CMSVersion,
* originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
* recipientInfos RecipientInfos,
* encryptedContentInfo EncryptedContentInfo,
* unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
if (originatorInfo != null)
{
v.add(new DERTaggedObject(false, 0, originatorInfo));
}
v.add(recipientInfos);
v.add(encryptedContentInfo);
if (unprotectedAttrs != null)
{
v.add(new DERTaggedObject(false, 1, unprotectedAttrs));
}
return new BERSequence(v);
}
示例6: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* <pre>
* TimeStampedData ::= SEQUENCE {
* version INTEGER { v1(1) },
* dataUri IA5String OPTIONAL,
* metaData MetaData OPTIONAL,
* content OCTET STRING OPTIONAL,
* temporalEvidence Evidence
* }
* </pre>
* @return
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
if (dataUri != null)
{
v.add(dataUri);
}
if (metaData != null)
{
v.add(metaData);
}
if (content != null)
{
v.add(content);
}
v.add(temporalEvidence);
return new BERSequence(v);
}
示例7: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* <pre>
* TimeStampedData ::= SEQUENCE {
* version INTEGER { v1(1) },
* dataUri IA5String OPTIONAL,
* metaData MetaData OPTIONAL,
* content OCTET STRING OPTIONAL,
* temporalEvidence Evidence
* }
* </pre>
* @return
* @deprecated will be removed
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
if (dataUri != null)
{
v.add(dataUri);
}
if (metaData != null)
{
v.add(metaData);
}
if (content != null)
{
v.add(content);
}
v.add(temporalEvidence);
return new BERSequence(v);
}
示例8: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
if (originatorInfo != null)
{
v.add(new DERTaggedObject(false, 0, originatorInfo));
}
v.add(recipientInfos);
v.add(encryptedContentInfo);
if (unprotectedAttrs != null)
{
v.add(new DERTaggedObject(false, 1, unprotectedAttrs));
}
return new BERSequence(v);
}
示例9: toASN1Primitive
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
if (dataUri != null)
{
v.add(dataUri);
}
if (metaData != null)
{
v.add(metaData);
}
if (content != null)
{
v.add(content);
}
v.add(temporalEvidence);
return new BERSequence(v);
}
示例10: shouldFailOnExtraData
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public void shouldFailOnExtraData()
throws Exception
{
// basic construction
DERBitString s1 = new DERBitString(new byte[0], 0);
ASN1Primitive.fromByteArray(s1.getEncoded());
ASN1Primitive.fromByteArray(new BERSequence(s1).getEncoded());
try
{
ASN1Primitive obj = ASN1Primitive.fromByteArray(Arrays.concatenate(s1.getEncoded(), new byte[1]));
fail("no exception");
}
catch (IOException e)
{
if (!"Extra data detected in stream".equals(e.getMessage()))
{
fail("wrong exception");
}
}
}
示例11: getDERObject
import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SignedData ::= SEQUENCE {
* version Version,
* digestAlgorithms DigestAlgorithmIdentifiers,
* contentInfo ContentInfo,
* certificates
* [0] IMPLICIT ExtendedCertificatesAndCertificates
* OPTIONAL,
* crls
* [1] IMPLICIT CertificateRevocationLists OPTIONAL,
* signerInfos SignerInfos }
* </pre>
*/
public DERObject getDERObject()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(digestAlgorithms);
v.add(contentInfo);
if (certificates != null)
{
v.add(new DERTaggedObject(false, 0, certificates));
}
if (crls != null)
{
v.add(new DERTaggedObject(false, 1, crls));
}
v.add(signerInfos);
return new BERSequence(v);
}