本文整理汇总了Java中org.bouncycastle.asn1.BERTaggedObject类的典型用法代码示例。如果您正苦于以下问题:Java BERTaggedObject类的具体用法?Java BERTaggedObject怎么用?Java BERTaggedObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BERTaggedObject类属于org.bouncycastle.asn1包,在下文中一共展示了BERTaggedObject类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的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);
}
}
示例2: writeSetToGeneratorTagged
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
private static void writeSetToGeneratorTagged(
ASN1Generator asn1Gen,
ASN1SetParser asn1SetParser,
int tagNo)
throws IOException
{
ASN1Set asn1Set = getASN1Set(asn1SetParser);
if (asn1Set != null)
{
if (asn1SetParser instanceof BERSetParser)
{
asn1Gen.getRawOutputStream().write(new BERTaggedObject(false, tagNo, asn1Set).getEncoded());
}
else
{
asn1Gen.getRawOutputStream().write(new DERTaggedObject(false, tagNo, asn1Set).getEncoded());
}
}
}
示例3: toASN1Object
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* ContentInfo ::= SEQUENCE {
* contentType ContentType,
* content
* [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
* </pre>
*/
public DERObject toASN1Object()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
if (content != null)
{
v.add(new BERTaggedObject(0, content));
}
return new BERSequence(v);
}
示例4: EncryptedData
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
public EncryptedData(
ASN1ObjectIdentifier contentType,
AlgorithmIdentifier encryptionAlgorithm,
ASN1Encodable content)
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
v.add(encryptionAlgorithm.toASN1Primitive());
v.add(new BERTaggedObject(false, 0, content));
data = new BERSequence(v);
}
示例5: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SignedData ::= SEQUENCE {
* version CMSVersion,
* digestAlgorithms DigestAlgorithmIdentifiers,
* encapContentInfo EncapsulatedContentInfo,
* certificates [0] IMPLICIT CertificateSet 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)
{
if (certsBer)
{
v.add(new BERTaggedObject(false, 0, certificates));
}
else
{
v.add(new DERTaggedObject(false, 0, certificates));
}
}
if (crls != null)
{
if (crlsBer)
{
v.add(new BERTaggedObject(false, 1, crls));
}
else
{
v.add(new DERTaggedObject(false, 1, crls));
}
}
v.add(signerInfos);
return new BERSequence(v);
}
示例6: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* <pre>
* EncryptedData ::= SEQUENCE {
* version CMSVersion,
* encryptedContentInfo EncryptedContentInfo,
* unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL }
* </pre>
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(encryptedContentInfo);
if (unprotectedAttrs != null)
{
v.add(new BERTaggedObject(false, 1, unprotectedAttrs));
}
return new BERSequence(v);
}
示例7: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* EncryptedContentInfo ::= SEQUENCE {
* contentType ContentType,
* contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
* encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
v.add(contentEncryptionAlgorithm);
if (encryptedContent != null)
{
v.add(new BERTaggedObject(false, 0, encryptedContent));
}
return new BERSequence(v);
}
示例8: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的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(0, content));
}
return new BERSequence(v);
}
示例9: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(digestAlgorithms);
v.add(contentInfo);
if (certificates != null)
{
if (certsBer)
{
v.add(new BERTaggedObject(false, 0, certificates));
}
else
{
v.add(new DERTaggedObject(false, 0, certificates));
}
}
if (crls != null)
{
if (crlsBer)
{
v.add(new BERTaggedObject(false, 1, crls));
}
else
{
v.add(new DERTaggedObject(false, 1, crls));
}
}
v.add(signerInfos);
return new BERSequence(v);
}
示例10: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(encryptedContentInfo);
if (unprotectedAttrs != null)
{
v.add(new BERTaggedObject(false, 1, unprotectedAttrs));
}
return new BERSequence(v);
}
示例11: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
v.add(contentEncryptionAlgorithm);
if (encryptedContent != null)
{
v.add(new BERTaggedObject(false, 0, encryptedContent));
}
return new BERSequence(v);
}
示例12: toASN1Primitive
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
/**
* Produce an object suitable for an ASN1OutputStream.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(contentType);
if (content != null)
{
v.add(new BERTaggedObject(0, content));
}
return new BERSequence(v);
}
示例13: dumpTaggedObject
import org.bouncycastle.asn1.BERTaggedObject; //导入依赖的package包/类
private String dumpTaggedObject(ASN1TaggedObject o) throws Asn1Exception, IOException {
StringBuilder sb = new StringBuilder();
sb.append(indentSequence.toString(indentLevel));
if (o instanceof BERTaggedObject) {
sb.append("BER TAGGED [");
} else {
sb.append("TAGGED [");
}
sb.append(Integer.toString(o.getTagNo()));
sb.append(']');
if (!o.isExplicit()) {
sb.append(" IMPLICIT ");
}
sb.append(":");
sb.append(NEWLINE);
if (o.isEmpty()) {
sb.append("EMPTY");
} else {
sb.append(dump(o.getObject()));
}
return sb.toString();
}