当前位置: 首页>>代码示例>>Java>>正文


Java ASN1Boolean类代码示例

本文整理汇总了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());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:Extension.java

示例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());
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:PKIArchiveOptions.java

示例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++));
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:MetaData.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:18,代码来源:TSTInfo.java

示例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;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:17,代码来源:TimeStampReq.java

示例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);
        }
    }
}
 
开发者ID:xipki,项目名称:xitk,代码行数:18,代码来源:Asn1NewKeyControl.java

示例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));
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:31,代码来源:X509Extensions.java

示例8: toASN1Primitive

import org.bouncycastle.asn1.ASN1Boolean; //导入依赖的package包/类
/**
 * <pre>
 *     Extensions        ::=   SEQUENCE SIZE (1..MAX) OF Extension
 *
 *     Extension         ::=   SEQUENCE {
 *        extnId            EXTENSION.&amp;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);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:36,代码来源:X509Extensions.java

示例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));
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:22,代码来源:DeclarationOfMajority.java

示例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;
}
 
开发者ID:grandamp,项目名称:SCVPAPI,代码行数:18,代码来源:ValidationPolicy.java

示例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;
    }
}
 
开发者ID:cwgit,项目名称:ximix,代码行数:19,代码来源:TranscriptDownloadMessage.java


注:本文中的org.bouncycastle.asn1.ASN1Boolean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。