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


Java ASN1Boolean.getInstance方法代码示例

本文整理汇总了Java中org.bouncycastle.asn1.ASN1Boolean.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ASN1Boolean.getInstance方法的具体用法?Java ASN1Boolean.getInstance怎么用?Java ASN1Boolean.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bouncycastle.asn1.ASN1Boolean的用法示例。


在下文中一共展示了ASN1Boolean.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: BasicConstraints

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public BasicConstraints(
    boolean cA)
{
    if (cA)
    {
        this.cA = ASN1Boolean.getInstance(true);
    }
    else
    {
        this.cA = null;
    }
    this.pathLenConstraint = null;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:14,代码来源:BasicConstraints.java

示例4: BasicConstraints

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private BasicConstraints(
    ASN1Sequence   seq)
{
    if (seq.size() == 0)
    {
        this.cA = null;
        this.pathLenConstraint = null;
    }
    else
    {
        if (seq.getObjectAt(0) instanceof ASN1Boolean)
        {
            this.cA = ASN1Boolean.getInstance(seq.getObjectAt(0));
        }
        else
        {
            this.cA = null;
            this.pathLenConstraint = ASN1Integer.getInstance(seq.getObjectAt(0));
        }
        if (seq.size() > 1)
        {
            if (this.cA != null)
            {
                this.pathLenConstraint = ASN1Integer.getInstance(seq.getObjectAt(1));
            }
            else
            {
                throw new IllegalArgumentException("wrong sequence in constructor");
            }
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:33,代码来源:BasicConstraints.java

示例5: BasicConstraints

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
/**
 * create a cA=true object for the given path length constraint.
 * 
 * @param pathLenConstraint
 */
public BasicConstraints(
    int     pathLenConstraint)
{
    this.cA = ASN1Boolean.getInstance(true);
    this.pathLenConstraint = new ASN1Integer(pathLenConstraint);
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:12,代码来源:BasicConstraints.java

示例6: TSTInfo

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private TSTInfo(ASN1Sequence seq)
{
    Enumeration e = seq.getObjects();

    // version
    version = ASN1Integer.getInstance(e.nextElement());

    // tsaPolicy
    tsaPolicyId = ASN1ObjectIdentifier.getInstance(e.nextElement());

    // messageImprint
    messageImprint = MessageImprint.getInstance(e.nextElement());

    // serialNumber
    serialNumber = ASN1Integer.getInstance(e.nextElement());

    // genTime
    genTime = ASN1GeneralizedTime.getInstance(e.nextElement());

    // default for ordering
    ordering = ASN1Boolean.getInstance(false);
    
    while (e.hasMoreElements())
    {
        ASN1Object o = (ASN1Object) e.nextElement();

        if (o instanceof ASN1TaggedObject)
        {
            DERTaggedObject tagged = (DERTaggedObject) o;

            switch (tagged.getTagNo())
            {
            case 0:
                tsa = GeneralName.getInstance(tagged, true);
                break;
            case 1:
                extensions = Extensions.getInstance(tagged, false);
                break;
            default:
                throw new IllegalArgumentException("Unknown tag value " + tagged.getTagNo());
            }
        }
        else if (o instanceof ASN1Sequence || o instanceof Accuracy)
        {
            accuracy = Accuracy.getInstance(o);
        }
        else if (o instanceof ASN1Boolean)
        {
            ordering = ASN1Boolean.getInstance(o);
        }
        else if (o instanceof ASN1Integer)
        {
            nonce = ASN1Integer.getInstance(o);
        }

    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:58,代码来源:TSTInfo.java

示例7: TimeStampReq

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private TimeStampReq(ASN1Sequence seq)
{
    int nbObjects = seq.size();

    int seqStart = 0;

    // version
    version = ASN1Integer.getInstance(seq.getObjectAt(seqStart));

    seqStart++;

    // messageImprint
    messageImprint = MessageImprint.getInstance(seq.getObjectAt(seqStart));

    seqStart++;

    for (int opt = seqStart; opt < nbObjects; opt++)
    {
        // tsaPolicy
        if (seq.getObjectAt(opt) instanceof ASN1ObjectIdentifier)
        {
            tsaPolicy = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(opt));
        }
        // nonce
        else if (seq.getObjectAt(opt) instanceof ASN1Integer)
        {
            nonce = ASN1Integer.getInstance(seq.getObjectAt(opt));
        }
        // certReq
        else if (seq.getObjectAt(opt) instanceof ASN1Boolean)
        {
            certReq = ASN1Boolean.getInstance(seq.getObjectAt(opt));
        }
        // extensions
        else if (seq.getObjectAt(opt) instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject    tagged = (ASN1TaggedObject)seq.getObjectAt(opt);
            if (tagged.getTagNo() == 0)
            {
                extensions = Extensions.getInstance(tagged, false);
            }
        }
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:45,代码来源:TimeStampReq.java

示例8: setCertReq

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public void setCertReq(
    boolean certReq)
{
    this.certReq = ASN1Boolean.getInstance(certReq);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:6,代码来源:TimeStampRequestGenerator.java

示例9: setMetaData

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private void setMetaData(boolean hashProtected, DERUTF8String fileName, DERIA5String mediaType, Attributes attributes)
{
    this.metaData = new MetaData(ASN1Boolean.getInstance(hashProtected), fileName, mediaType, attributes);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:CMSTimeStampedGenerator.java

示例10: getDeclarationOfMajorityStringValue

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private String getDeclarationOfMajorityStringValue(byte[] octets) {

		// @formatter:off

		/*
			DeclarationOfMajoritySyntax ::= CHOICE
			{
				notYoungerThan [0] IMPLICIT INTEGER,
				fullAgeAtCountry [1] IMPLICIT SEQUENCE {
					fullAge BOOLEAN DEFAULT TRUE,
					country PrintableString (SIZE(2))
				},
				dateOfBirth [2] IMPLICIT GeneralizedTime
			}
		 */

		// @formatter:on

		StringBuilder sb = new StringBuilder();

		DeclarationOfMajority declarationOfMajority = DeclarationOfMajority.getInstance(octets);
		int notYoungerThan = declarationOfMajority.notYoungerThan();
		ASN1Sequence fullAgeAtCountry = declarationOfMajority.fullAgeAtCountry();
		ASN1GeneralizedTime dateOfBirth = declarationOfMajority.getDateOfBirth();

		if (notYoungerThan != -1) {
			sb.append(MessageFormat.format(res.getString("DeclarationOfMajority.notYoungerThan"), notYoungerThan));
			sb.append(NEWLINE);
		}

		if (fullAgeAtCountry != null) {
			ASN1Boolean fullAge = ASN1Boolean.getInstance(fullAgeAtCountry.getObjectAt(0));
			DERPrintableString country = DERPrintableString.getInstance(fullAgeAtCountry.getObjectAt(1));

			sb.append(MessageFormat.format(res.getString("DeclarationOfMajority.fullAgeAtCountry"), country.toString(),
					fullAge.toString()));
			sb.append(NEWLINE);
		}

		if (dateOfBirth != null) {
			sb.append(MessageFormat.format(res.getString("DeclarationOfMajority.dateOfBirth"), dateOfBirth));
			sb.append(NEWLINE);
		}

		return sb.toString();
	}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:47,代码来源:X509Ext.java

示例11: ResponseFlags

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public ResponseFlags(boolean fullRequestInResponse, boolean responseValidationPolByRef, boolean protectResponse, boolean cachedResponse) {
	this.fullRequestInResponse = ASN1Boolean.getInstance(fullRequestInResponse);
	this.responseValidationPolByRef = ASN1Boolean.getInstance(responseValidationPolByRef);
	this.protectResponse = ASN1Boolean.getInstance(protectResponse);
	this.cachedResponse = ASN1Boolean.getInstance(cachedResponse);
}
 
开发者ID:grandamp,项目名称:SCVPAPI,代码行数:7,代码来源:ResponseFlags.java

示例12: setInhibitAnyPolicy

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public void setInhibitAnyPolicy(boolean inhibit) {
	this.inhibitAnyPolicy = ASN1Boolean.getInstance(inhibit);
}
 
开发者ID:grandamp,项目名称:SCVPAPI,代码行数:4,代码来源:SCVPRequestBuilder.java

示例13: setRequireExplicitPolicy

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public void setRequireExplicitPolicy(boolean require) {
	this.requireExplicitPolicy = ASN1Boolean.getInstance(require);
}
 
开发者ID:grandamp,项目名称:SCVPAPI,代码行数:4,代码来源:SCVPRequestBuilder.java

示例14: setInhibitPolicyMapping

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
public void setInhibitPolicyMapping(boolean inhibit) {
	this.inhibitPolicyMapping = ASN1Boolean.getInstance(inhibit);
}
 
开发者ID:grandamp,项目名称:SCVPAPI,代码行数:4,代码来源:SCVPRequestBuilder.java

示例15: getLiabilityLimitationFlagStringValue

import org.bouncycastle.asn1.ASN1Boolean; //导入方法依赖的package包/类
private String getLiabilityLimitationFlagStringValue(byte[] octets) {

		/*	LiabilityLimitationFlagSyntax ::= BOOLEAN */

		ASN1Boolean asn1Boolean = ASN1Boolean.getInstance(octets);
		return asn1Boolean.toString();
	}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:8,代码来源:X509Ext.java


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