當前位置: 首頁>>代碼示例>>Java>>正文


Java ASN1Integer類代碼示例

本文整理匯總了Java中org.bouncycastle.asn1.ASN1Integer的典型用法代碼示例。如果您正苦於以下問題:Java ASN1Integer類的具體用法?Java ASN1Integer怎麽用?Java ASN1Integer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ASN1Integer類屬於org.bouncycastle.asn1包,在下文中一共展示了ASN1Integer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PollRepContent

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
private PollRepContent(ASN1Sequence seq)
{
    certReqId = new ASN1Integer[seq.size()];
    checkAfter = new ASN1Integer[seq.size()];
    reason = new PKIFreeText[seq.size()];

    for (int i = 0; i != seq.size(); i++)
    {
        ASN1Sequence s = ASN1Sequence.getInstance(seq.getObjectAt(i));

        certReqId[i] = ASN1Integer.getInstance(s.getObjectAt(0));
        checkAfter[i] = ASN1Integer.getInstance(s.getObjectAt(1));

        if (s.size() > 2)
        {
            reason[i] = PKIFreeText.getInstance(s.getObjectAt(2));
        }
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:20,代碼來源:PollRepContent.java

示例2: DVCSCertInfo

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
public DVCSCertInfo(
    DVCSRequestInformation dvReqInfo,
    DigestInfo messageImprint,
    ASN1Integer serialNumber,
    DVCSTime responseTime)
{
    this.dvReqInfo = dvReqInfo;
    this.messageImprint = messageImprint;
    this.serialNumber = serialNumber;
    this.responseTime = responseTime;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:12,代碼來源:DVCSCertInfo.java

示例3: CertResponse

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
public CertResponse(
    ASN1Integer certReqId,
    PKIStatusInfo status,
    CertifiedKeyPair certifiedKeyPair,
    ASN1OctetString rspInfo)
{
    if (certReqId == null)
    {
        throw new IllegalArgumentException("'certReqId' cannot be null");
    }
    if (status == null)
    {
        throw new IllegalArgumentException("'status' cannot be null");
    }
    this.certReqId = certReqId;
    this.status = status;
    this.certifiedKeyPair = certifiedKeyPair;
    this.rspInfo = rspInfo;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:20,代碼來源:CertResponse.java

示例4: toASN1Primitive

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
@Override
public ASN1Primitive toASN1Primitive() {
    ASN1EncodableVector vector = new ASN1EncodableVector();
    vector.add(new Asn1P11SlotIdentifier(slotId));
    vector.add(new DERUTF8String(label));
    vector.add(new ASN1Integer(keysize));
    if (publicExponent != null) {
        vector.add(new ASN1Integer(publicExponent));
    }
    return new DERSequence(vector);
}
 
開發者ID:xipki,項目名稱:xitk,代碼行數:12,代碼來源:Asn1GenRSAKeypairParams.java

示例5: McElieceCCA2PublicKey

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
private McElieceCCA2PublicKey(ASN1Sequence seq)
{
    oid = ((ASN1ObjectIdentifier)seq.getObjectAt(0));
    BigInteger bigN = ((ASN1Integer)seq.getObjectAt(1)).getValue();
    n = bigN.intValue();

    BigInteger bigT = ((ASN1Integer)seq.getObjectAt(2)).getValue();
    t = bigT.intValue();

    matrixG = ((ASN1OctetString)seq.getObjectAt(3)).getOctets();
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:12,代碼來源:McElieceCCA2PublicKey.java

示例6: RSAPrivateKeyStructure

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
public RSAPrivateKeyStructure(
    ASN1Sequence  seq)
{
    Enumeration e = seq.getObjects();

    BigInteger  v = ((ASN1Integer)e.nextElement()).getValue();
    if (v.intValue() != 0 && v.intValue() != 1)
    {
        throw new IllegalArgumentException("wrong version for RSA private key");
    }

    version = v.intValue();
    modulus = ((ASN1Integer)e.nextElement()).getValue();
    publicExponent = ((ASN1Integer)e.nextElement()).getValue();
    privateExponent = ((ASN1Integer)e.nextElement()).getValue();
    prime1 = ((ASN1Integer)e.nextElement()).getValue();
    prime2 = ((ASN1Integer)e.nextElement()).getValue();
    exponent1 = ((ASN1Integer)e.nextElement()).getValue();
    exponent2 = ((ASN1Integer)e.nextElement()).getValue();
    coefficient = ((ASN1Integer)e.nextElement()).getValue();
    
    if (e.hasMoreElements())
    {
        otherPrimeInfos = (ASN1Sequence)e.nextElement();
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:27,代碼來源:RSAPrivateKeyStructure.java

示例7: toASN1Primitive

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
/**
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 *  ECParameters ::= SEQUENCE {
 *      version         INTEGER { ecpVer1(1) } (ecpVer1),
 *      fieldID         FieldID {{FieldTypes}},
 *      curve           X9Curve,
 *      base            X9ECPoint,
 *      order           INTEGER,
 *      cofactor        INTEGER OPTIONAL
 *  }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(new ASN1Integer(1));
    v.add(fieldID);
    v.add(new X9Curve(curve, seed));
    v.add(new X9ECPoint(g));
    v.add(new ASN1Integer(n));

    if (h != null)
    {
        v.add(new ASN1Integer(h));
    }

    return new DERSequence(v);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:31,代碼來源:X9ECParameters.java

示例8: PBKDF2Params

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
private PBKDF2Params(
    ASN1Sequence  seq)
{
    Enumeration e = seq.getObjects();

    octStr = (ASN1OctetString)e.nextElement();
    iterationCount = (ASN1Integer)e.nextElement();

    if (e.hasMoreElements())
    {
        keyLength = (ASN1Integer)e.nextElement();
    }
    else
    {
        keyLength = null;
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:18,代碼來源:PBKDF2Params.java

示例9: engineGetEncoded

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
/**
 * Return the PKCS#1 ASN.1 structure RSASSA-PSS-params.
 */
protected byte[] engineGetEncoded() 
    throws IOException
{
    PSSParameterSpec pssSpec = currentSpec;
    AlgorithmIdentifier hashAlgorithm = new AlgorithmIdentifier(
                                        DigestFactory.getOID(pssSpec.getDigestAlgorithm()),
                                        DERNull.INSTANCE);
    MGF1ParameterSpec mgfSpec = (MGF1ParameterSpec)pssSpec.getMGFParameters();
    AlgorithmIdentifier maskGenAlgorithm = new AlgorithmIdentifier(
                                        PKCSObjectIdentifiers.id_mgf1,
                                        new AlgorithmIdentifier(DigestFactory.getOID(mgfSpec.getDigestAlgorithm()), DERNull.INSTANCE));
    RSASSAPSSparams pssP = new RSASSAPSSparams(hashAlgorithm, maskGenAlgorithm, new ASN1Integer(pssSpec.getSaltLength()), new ASN1Integer(pssSpec.getTrailerField()));
    
    return pssP.getEncoded("DER");
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:19,代碼來源:AlgorithmParametersSpi.java

示例10: EnvelopedData

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
/**
 * @deprecated use getInstance()
 */
public EnvelopedData(
    ASN1Sequence seq)
{
    int     index = 0;
    
    version = (ASN1Integer)seq.getObjectAt(index++);
    
    Object  tmp = seq.getObjectAt(index++);

    if (tmp instanceof ASN1TaggedObject)
    {
        originatorInfo = OriginatorInfo.getInstance((ASN1TaggedObject)tmp, false);
        tmp = seq.getObjectAt(index++);
    }

    recipientInfos = ASN1Set.getInstance(tmp);
    
    encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(index++));
    
    if(seq.size() > index)
    {
        unprotectedAttrs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(index), false);
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:28,代碼來源:EnvelopedData.java

示例11: CscaMasterList

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
private CscaMasterList(
    ASN1Sequence seq)
{
    if (seq == null || seq.size() == 0)
    {
        throw new IllegalArgumentException(
            "null or empty sequence passed.");
    }
    if (seq.size() != 2)
    {
        throw new IllegalArgumentException(
            "Incorrect sequence size: " + seq.size());
    }

    version = ASN1Integer.getInstance(seq.getObjectAt(0));
    ASN1Set certSet = ASN1Set.getInstance(seq.getObjectAt(1));
    certList = new Certificate[certSet.size()];
    for (int i = 0; i < certList.length; i++)
    {
        certList[i]
            = Certificate.getInstance(certSet.getObjectAt(i));
    }
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:24,代碼來源:CscaMasterList.java

示例12: DHDomainParameters

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
public DHDomainParameters(ASN1Integer p, ASN1Integer g, ASN1Integer q, ASN1Integer j,
    DHValidationParms validationParms)
{
    if (p == null)
    {
        throw new IllegalArgumentException("'p' cannot be null");
    }
    if (g == null)
    {
        throw new IllegalArgumentException("'g' cannot be null");
    }
    if (q == null)
    {
        throw new IllegalArgumentException("'q' cannot be null");
    }

    this.p = p;
    this.g = g;
    this.q = q;
    this.j = j;
    this.validationParms = validationParms;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:23,代碼來源:DHDomainParameters.java

示例13: TimeStampedData

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
private TimeStampedData(ASN1Sequence seq)
{
    this.version = ASN1Integer.getInstance(seq.getObjectAt(0));

    int index = 1;
    if (seq.getObjectAt(index) instanceof DERIA5String)
    {
        this.dataUri = DERIA5String.getInstance(seq.getObjectAt(index++));
    }
    if (seq.getObjectAt(index) instanceof MetaData || seq.getObjectAt(index) instanceof ASN1Sequence)
    {
        this.metaData = MetaData.getInstance(seq.getObjectAt(index++));
    }
    if (seq.getObjectAt(index) instanceof ASN1OctetString)
    {
        this.content = ASN1OctetString.getInstance(seq.getObjectAt(index++));
    }
    this.temporalEvidence = Evidence.getInstance(seq.getObjectAt(index));
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:20,代碼來源:TimeStampedData.java

示例14: AuthorityKeyIdentifier

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
/**
 * create an AuthorityKeyIdentifier with the GeneralNames tag and
 * the serial number provided as well.
 */
public AuthorityKeyIdentifier(
    SubjectPublicKeyInfo    spki,
    GeneralNames            name,
    BigInteger              serialNumber)
{
    Digest  digest = new SHA1Digest();
    byte[]  resBuf = new byte[digest.getDigestSize()];

    byte[] bytes = spki.getPublicKeyData().getBytes();
    digest.update(bytes, 0, bytes.length);
    digest.doFinal(resBuf, 0);

    this.keyidentifier = new DEROctetString(resBuf);
    this.certissuer = GeneralNames.getInstance(name.toASN1Primitive());
    this.certserno = new ASN1Integer(serialNumber);
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:21,代碼來源:AuthorityKeyIdentifier.java

示例15: SignerInfo

import org.bouncycastle.asn1.ASN1Integer; //導入依賴的package包/類
public SignerInfo(
    SignerIdentifier        sid,
    AlgorithmIdentifier     digAlgorithm,
    ASN1Set                 authenticatedAttributes,
    AlgorithmIdentifier     digEncryptionAlgorithm,
    ASN1OctetString         encryptedDigest,
    ASN1Set                 unauthenticatedAttributes)
{
    if (sid.isTagged())
    {
        this.version = new ASN1Integer(3);
    }
    else
    {
        this.version = new ASN1Integer(1);
    }

    this.sid = sid;
    this.digAlgorithm = digAlgorithm;
    this.authenticatedAttributes = authenticatedAttributes;
    this.digEncryptionAlgorithm = digEncryptionAlgorithm;
    this.encryptedDigest = encryptedDigest;
    this.unauthenticatedAttributes = unauthenticatedAttributes;
}
 
開發者ID:Appdome,項目名稱:ipack,代碼行數:25,代碼來源:SignerInfo.java


注:本文中的org.bouncycastle.asn1.ASN1Integer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。