本文整理汇总了Java中org.bouncycastle.asn1.ASN1Boolean类的典型用法代码示例。如果您正苦于以下问题:Java ASN1Boolean类的具体用法?Java ASN1Boolean怎么用?Java ASN1Boolean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ASN1Boolean类属于org.bouncycastle.asn1包,在下文中一共展示了ASN1Boolean类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Extension
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
private Extension(ASN1Sequence seq)
{
if (seq.size() == 2)
{
this.extnId = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
this.critical = false;
this.value = ASN1OctetString.getInstance(seq.getObjectAt(1));
}
else if (seq.size() == 3)
{
this.extnId = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
this.critical = ASN1Boolean.getInstance(seq.getObjectAt(1)).isTrue();
this.value = ASN1OctetString.getInstance(seq.getObjectAt(2));
}
else
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
}
示例2: PKIArchiveOptions
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
private PKIArchiveOptions(ASN1TaggedObject tagged)
{
switch (tagged.getTagNo())
{
case encryptedPrivKey:
value = EncryptedKey.getInstance(tagged.getObject());
break;
case keyGenParameters:
value = ASN1OctetString.getInstance(tagged, false);
break;
case archiveRemGenPrivKey:
value = ASN1Boolean.getInstance(tagged, false);
break;
default:
throw new IllegalArgumentException("unknown tag number: " + tagged.getTagNo());
}
}
示例3: MetaData
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
private MetaData(ASN1Sequence seq)
{
this.hashProtected = ASN1Boolean.getInstance(seq.getObjectAt(0));
int index = 1;
if (index < seq.size() && seq.getObjectAt(index) instanceof DERUTF8String)
{
this.fileName = DERUTF8String.getInstance(seq.getObjectAt(index++));
}
if (index < seq.size() && seq.getObjectAt(index) instanceof DERIA5String)
{
this.mediaType = DERIA5String.getInstance(seq.getObjectAt(index++));
}
if (index < seq.size())
{
this.otherMetaData = Attributes.getInstance(seq.getObjectAt(index++));
}
}
示例4: TSTInfo
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
public TSTInfo(ASN1ObjectIdentifier tsaPolicyId, MessageImprint messageImprint,
ASN1Integer serialNumber, ASN1GeneralizedTime genTime,
Accuracy accuracy, ASN1Boolean ordering, ASN1Integer nonce,
GeneralName tsa, Extensions extensions)
{
version = new ASN1Integer(1);
this.tsaPolicyId = tsaPolicyId;
this.messageImprint = messageImprint;
this.serialNumber = serialNumber;
this.genTime = genTime;
this.accuracy = accuracy;
this.ordering = ordering;
this.nonce = nonce;
this.tsa = tsa;
this.extensions = extensions;
}
示例5: TimeStampReq
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
public TimeStampReq(
MessageImprint messageImprint,
ASN1ObjectIdentifier tsaPolicy,
ASN1Integer nonce,
ASN1Boolean certReq,
Extensions extensions)
{
// default
version = new ASN1Integer(1);
this.messageImprint = messageImprint;
this.tsaPolicy = tsaPolicy;
this.nonce = nonce;
this.certReq = certReq;
this.extensions = extensions;
}
示例6: Asn1NewKeyControl
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
private Asn1NewKeyControl(ASN1Sequence seq) throws BadAsn1ObjectException {
control = new P11NewKeyControl();
final int size = seq.size();
for (int i = 0; i < size; i++) {
ASN1Encodable obj = seq.getObjectAt(i);
if (obj instanceof ASN1TaggedObject) {
continue;
}
ASN1TaggedObject tagObj = (ASN1TaggedObject) obj;
int tagNo = tagObj.getTagNo();
if (tagNo == 0) {
boolean bv = ((ASN1Boolean) tagObj.getObject()).isTrue();
control.setExtractable(bv);
}
}
}
示例7: X509Extensions
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
/**
* Constructor from ASN1Sequence.
*
* the extensions are a list of constructed sequences, either with (OID, OctetString) or (OID, Boolean, OctetString)
*/
public X509Extensions(
ASN1Sequence seq)
{
Enumeration e = seq.getObjects();
while (e.hasMoreElements())
{
ASN1Sequence s = ASN1Sequence.getInstance(e.nextElement());
if (s.size() == 3)
{
extensions.put(s.getObjectAt(0), new X509Extension(ASN1Boolean.getInstance(s.getObjectAt(1)), ASN1OctetString.getInstance(s.getObjectAt(2))));
}
else if (s.size() == 2)
{
extensions.put(s.getObjectAt(0), new X509Extension(false, ASN1OctetString.getInstance(s.getObjectAt(1))));
}
else
{
throw new IllegalArgumentException("Bad sequence size: " + s.size());
}
ordering.addElement(s.getObjectAt(0));
}
}
示例8: toASN1Primitive
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
/**
* <pre>
* Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
*
* Extension ::= SEQUENCE {
* extnId EXTENSION.&id ({ExtensionSet}),
* critical BOOLEAN DEFAULT FALSE,
* extnValue OCTET STRING }
* </pre>
*/
public ASN1Primitive toASN1Primitive()
{
ASN1EncodableVector vec = new ASN1EncodableVector();
Enumeration e = ordering.elements();
while (e.hasMoreElements())
{
ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)e.nextElement();
X509Extension ext = (X509Extension)extensions.get(oid);
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(oid);
if (ext.isCritical())
{
v.add(ASN1Boolean.TRUE);
}
v.add(ext.getValue());
vec.add(new DERSequence(v));
}
return new DERSequence(vec);
}
示例9: DeclarationOfMajority
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
public DeclarationOfMajority(boolean fullAge, String country)
{
if (country.length() > 2)
{
throw new IllegalArgumentException("country can only be 2 characters");
}
if (fullAge)
{
declaration = new DERTaggedObject(false, 1, new DERSequence(new DERPrintableString(country, true)));
}
else
{
ASN1EncodableVector v = new ASN1EncodableVector();
v.add(ASN1Boolean.FALSE);
v.add(new DERPrintableString(country, true));
declaration = new DERTaggedObject(false, 1, new DERSequence(v));
}
}
示例10: ValidationPolicy
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
public ValidationPolicy(ValidationPolRef validationPolRef,
ValidationAlg validationAlg, UserPolicySet userPolicySet,
ASN1Boolean inhibitPolicyMapping,
ASN1Boolean requireExplicitPolicy, ASN1Boolean inhibitAnyPolicy,
TrustAnchors trustAnchors, KeyUsages keyUsages,
KeyPurposeIds extendedKeyUsages, KeyPurposeIds specifiedKeyUsages) {
this.validationPolRef = validationPolRef;
this.validationAlg = validationAlg;
this.userPolicySet = userPolicySet;
this.inhibitPolicyMapping = inhibitPolicyMapping;
this.requireExplicitPolicy = requireExplicitPolicy;
this.inhibitAnyPolicy = inhibitAnyPolicy;
this.trustAnchors = trustAnchors;
this.keyUsages = keyUsages;
this.extendedKeyUsages = extendedKeyUsages;
this.specifiedKeyUsages = specifiedKeyUsages;
}
示例11: TranscriptDownloadMessage
import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
private TranscriptDownloadMessage(ASN1Sequence seq)
{
this.queryID = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue().longValue();
this.operationNumber = ASN1Integer.getInstance(seq.getObjectAt(1)).getValue().longValue();
this.stepNo = ASN1Integer.getInstance(seq.getObjectAt(2)).getValue().intValue();
this.type = TranscriptType.values()[ASN1Integer.getInstance(seq.getObjectAt(3)).getValue().intValue()];
this.maxNumberOfMessages = ASN1Integer.getInstance(seq.getObjectAt(4)).getValue().intValue();
this.withPairing = ASN1Boolean.getInstance(seq.getObjectAt(5)).isTrue();
if (seq.size() > 6)
{
this.seed = ASN1OctetString.getInstance(seq.getObjectAt(6)).getOctets();
}
else
{
this.seed = null;
}
}