本文整理匯總了Java中org.bouncycastle.asn1.ASN1EncodableVector.add方法的典型用法代碼示例。如果您正苦於以下問題:Java ASN1EncodableVector.add方法的具體用法?Java ASN1EncodableVector.add怎麽用?Java ASN1EncodableVector.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.ASN1EncodableVector
的用法示例。
在下文中一共展示了ASN1EncodableVector.add方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* BasicConstraints := SEQUENCE {
* cA BOOLEAN DEFAULT FALSE,
* pathLenConstraint INTEGER (0..MAX) OPTIONAL
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (cA != null)
{
v.add(cA);
}
if (pathLenConstraint != null) // yes some people actually do this when cA is false...
{
v.add(pathLenConstraint);
}
return new DERSequence(v);
}
示例2: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* SignerInfo ::= SEQUENCE {
* version Version,
* SignerIdentifier sid,
* digestAlgorithm DigestAlgorithmIdentifier,
* authenticatedAttributes [0] IMPLICIT Attributes OPTIONAL,
* digestEncryptionAlgorithm DigestEncryptionAlgorithmIdentifier,
* encryptedDigest EncryptedDigest,
* unauthenticatedAttributes [1] IMPLICIT Attributes OPTIONAL
* }
*
* EncryptedDigest ::= OCTET STRING
*
* DigestAlgorithmIdentifier ::= AlgorithmIdentifier
*
* DigestEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(sid);
v.add(digAlgorithm);
if (authenticatedAttributes != null)
{
v.add(new DERTaggedObject(false, 0, authenticatedAttributes));
}
v.add(digEncryptionAlgorithm);
v.add(encryptedDigest);
if (unauthenticatedAttributes != null)
{
v.add(new DERTaggedObject(false, 1, unauthenticatedAttributes));
}
return new DERSequence(v);
}
示例3: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* <pre>
* ESSCertIDv2 ::= SEQUENCE {
* hashAlgorithm AlgorithmIdentifier
* DEFAULT {algorithm id-sha256},
* certHash Hash,
* issuerSerial IssuerSerial OPTIONAL
* }
*
* Hash ::= OCTET STRING
*
* IssuerSerial ::= SEQUENCE {
* issuer GeneralNames,
* serialNumber CertificateSerialNumber
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (!hashAlgorithm.equals(DEFAULT_ALG_ID))
{
v.add(hashAlgorithm);
}
v.add(new DEROctetString(certHash).toASN1Primitive());
if (issuerSerial != null)
{
v.add(issuerSerial);
}
return new DERSequence(v);
}
示例4: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* RecipientKeyIdentifier ::= SEQUENCE {
* subjectKeyIdentifier SubjectKeyIdentifier,
* date GeneralizedTime OPTIONAL,
* other OtherKeyAttribute OPTIONAL
* }
*
* SubjectKeyIdentifier ::= OCTET STRING
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(subjectKeyIdentifier);
if (date != null)
{
v.add(date);
}
if (other != null)
{
v.add(other);
}
return new DERSequence(v);
}
示例5: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* @see org.bouncycastle.asn1.ASN1Object#toASN1Primitive()
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (valid != (signValid | bodyValid))
{
return null;
}
v.add(certificateBody);
try
{
v.add(new DERApplicationSpecific(false, EACTags.STATIC_INTERNAL_AUTHENTIFICATION_ONE_STEP, new DEROctetString(signature)));
}
catch (IOException e)
{
throw new IllegalStateException("unable to convert signature!");
}
return new DERApplicationSpecific(EACTags.CARDHOLDER_CERTIFICATE, v);
}
示例6: createReasonExtension
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
private static ASN1Sequence createReasonExtension(int reasonCode)
{
ASN1EncodableVector v = new ASN1EncodableVector();
CRLReason crlReason = CRLReason.lookup(reasonCode);
try
{
v.add(Extension.reasonCode);
v.add(new DEROctetString(crlReason.getEncoded()));
}
catch (IOException e)
{
throw new IllegalArgumentException("error encoding reason: " + e);
}
return new DERSequence(v);
}
示例7: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (version != null)
{
v.add(version);
}
v.add(iv);
return new DERSequence(v);
}
示例8: addOptional
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
private void addOptional(ASN1EncodableVector v, int tagNo, ASN1Encodable obj)
{
if (obj != null)
{
v.add(new DERTaggedObject(true, tagNo, obj));
}
}
示例9: generateTBSCertList
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
public TBSCertList generateTBSCertList()
{
if ((signature == null) || (issuer == null) || (thisUpdate == null))
{
throw new IllegalStateException("Not all mandatory fields set in V2 TBSCertList generator.");
}
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(version);
v.add(signature);
v.add(issuer);
v.add(thisUpdate);
if (nextUpdate != null)
{
v.add(nextUpdate);
}
// Add CRLEntries if they exist
if (crlentries.size() != 0)
{
v.add(new DERSequence(crlentries));
}
if (extensions != null)
{
v.add(new DERTaggedObject(0, extensions));
}
return new TBSCertList(new DERSequence(v));
}
示例10: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* Produce an object suitable for an ASN1OutputStream.
* <pre>
* Attribute ::= SEQUENCE {
* attrType OBJECT IDENTIFIER,
* attrValues SET OF AttributeValue
* }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(attrType);
v.add(attrValues);
return new DERSequence(v);
}
示例11: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(this.otherRevRefType);
v.add(this.otherRevRefs);
return new DERSequence(v);
}
示例12: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* <pre>
* SCVPReqRes ::= SEQUENCE {
* request [0] EXPLICIT ContentInfo OPTIONAL,
* response ContentInfo }
* </pre>
* @return the ASN.1 primitive representation.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
if (request != null)
{
v.add(new DERTaggedObject(true, 0, request));
}
v.add(response);
return new DERSequence(v);
}
示例13: toASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
/**
* <pre>
* RevDetails ::= SEQUENCE {
* certDetails CertTemplate,
* -- allows requester to specify as much as they can about
* -- the cert. for which revocation is requested
* -- (e.g., for cases in which serialNumber is not available)
* crlEntryDetails Extensions OPTIONAL
* -- requested crlEntryExtensions
* }
* </pre>
* @return a basic ASN.1 object representation.
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(certDetails);
if (crlEntryDetails != null)
{
v.add(crlEntryDetails);
}
return new DERSequence(v);
}
示例14: getASN1Primitive
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
public ASN1Primitive getASN1Primitive()
{
ASN1EncodableVector v = new ASN1EncodableVector();
ASN1EncodableVector subV = new ASN1EncodableVector();
v.add(objectId);
subV.add(func);
subV.add(scheme);
v.add(new DERSequence(subV));
return new DERSequence(v);
}
示例15: CertReqMessages
import org.bouncycastle.asn1.ASN1EncodableVector; //導入方法依賴的package包/類
public CertReqMessages(
CertReqMsg[] msgs)
{
ASN1EncodableVector v = new ASN1EncodableVector();
for (int i = 0; i < msgs.length; i++)
{
v.add(msgs[i]);
}
content = new DERSequence(v);
}