本文整理匯總了Java中org.bouncycastle.asn1.ASN1Integer.getInstance方法的典型用法代碼示例。如果您正苦於以下問題:Java ASN1Integer.getInstance方法的具體用法?Java ASN1Integer.getInstance怎麽用?Java ASN1Integer.getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bouncycastle.asn1.ASN1Integer
的用法示例。
在下文中一共展示了ASN1Integer.getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: CertResponse
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private CertResponse(ASN1Sequence seq)
{
certReqId = ASN1Integer.getInstance(seq.getObjectAt(0));
status = PKIStatusInfo.getInstance(seq.getObjectAt(1));
if (seq.size() >= 3)
{
if (seq.size() == 3)
{
ASN1Encodable o = seq.getObjectAt(2);
if (o instanceof ASN1OctetString)
{
rspInfo = ASN1OctetString.getInstance(o);
}
else
{
certifiedKeyPair = CertifiedKeyPair.getInstance(o);
}
}
else
{
certifiedKeyPair = CertifiedKeyPair.getInstance(seq.getObjectAt(2));
rspInfo = ASN1OctetString.getInstance(seq.getObjectAt(3));
}
}
}
示例2: getInstance
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
public static TypeOfBiometricData getInstance(Object obj)
{
if (obj == null || obj instanceof TypeOfBiometricData)
{
return (TypeOfBiometricData)obj;
}
if (obj instanceof ASN1Integer)
{
ASN1Integer predefinedBiometricTypeObj = ASN1Integer.getInstance(obj);
int predefinedBiometricType = predefinedBiometricTypeObj.getValue().intValue();
return new TypeOfBiometricData(predefinedBiometricType);
}
else if (obj instanceof ASN1ObjectIdentifier)
{
ASN1ObjectIdentifier BiometricDataID = ASN1ObjectIdentifier.getInstance(obj);
return new TypeOfBiometricData(BiometricDataID);
}
throw new IllegalArgumentException("unknown object in getInstance");
}
示例3: PKIStatusInfo
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private PKIStatusInfo(
ASN1Sequence seq)
{
this.status = ASN1Integer.getInstance(seq.getObjectAt(0));
this.statusString = null;
this.failInfo = null;
if (seq.size() > 2)
{
this.statusString = PKIFreeText.getInstance(seq.getObjectAt(1));
this.failInfo = DERBitString.getInstance(seq.getObjectAt(2));
}
else if (seq.size() > 1)
{
Object obj = seq.getObjectAt(1);
if (obj instanceof DERBitString)
{
this.failInfo = DERBitString.getInstance(obj);
}
else
{
this.statusString = PKIFreeText.getInstance(obj);
}
}
}
示例4: isPKCSParam
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private boolean isPKCSParam(ASN1Sequence seq)
{
if (seq.size() == 2)
{
return true;
}
if (seq.size() > 3)
{
return false;
}
ASN1Integer l = ASN1Integer.getInstance(seq.getObjectAt(2));
ASN1Integer p = ASN1Integer.getInstance(seq.getObjectAt(0));
if (l.getValue().compareTo(BigInteger.valueOf(p.getValue().bitLength())) > 0)
{
return false;
}
return true;
}
示例5: TimeStampedDataParser
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private TimeStampedDataParser(ASN1SequenceParser parser)
throws IOException
{
this.parser = parser;
this.version = ASN1Integer.getInstance(parser.readObject());
ASN1Encodable obj = parser.readObject();
if (obj instanceof DERIA5String)
{
this.dataUri = DERIA5String.getInstance(obj);
obj = parser.readObject();
}
if (obj instanceof MetaData || obj instanceof ASN1SequenceParser)
{
this.metaData = MetaData.getInstance(obj.toASN1Primitive());
obj = parser.readObject();
}
if (obj instanceof ASN1OctetStringParser)
{
this.content = (ASN1OctetStringParser)obj;
}
}
示例6: DHDomainParameters
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private DHDomainParameters(ASN1Sequence seq)
{
if (seq.size() < 3 || seq.size() > 5)
{
throw new IllegalArgumentException("Bad sequence size: " + seq.size());
}
Enumeration e = seq.getObjects();
this.p = ASN1Integer.getInstance(e.nextElement());
this.g = ASN1Integer.getInstance(e.nextElement());
this.q = ASN1Integer.getInstance(e.nextElement());
ASN1Encodable next = getNext(e);
if (next != null && next instanceof ASN1Integer)
{
this.j = ASN1Integer.getInstance(next);
next = getNext(e);
}
if (next != null)
{
this.validationParms = DHValidationParms.getInstance(next.toASN1Primitive());
}
}
示例7: BCElGamalPrivateKey
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
BCElGamalPrivateKey(
PrivateKeyInfo info)
throws IOException
{
ElGamalParameter params = new ElGamalParameter((ASN1Sequence)info.getAlgorithmId().getParameters());
DERInteger derX = ASN1Integer.getInstance(info.parsePrivateKey());
this.x = derX.getValue();
this.elSpec = new ElGamalParameterSpec(params.getP(), params.getG());
}
示例8: RainbowPublicKey
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private RainbowPublicKey(ASN1Sequence seq)
{
// <oidString> or version
if (seq.getObjectAt(0) instanceof ASN1Integer)
{
version = ASN1Integer.getInstance(seq.getObjectAt(0));
}
else
{
oid = ASN1ObjectIdentifier.getInstance(seq.getObjectAt(0));
}
docLength = ASN1Integer.getInstance(seq.getObjectAt(1));
ASN1Sequence asnCoeffQuad = ASN1Sequence.getInstance(seq.getObjectAt(2));
coeffQuadratic = new byte[asnCoeffQuad.size()][];
for (int quadSize = 0; quadSize < asnCoeffQuad.size(); quadSize++)
{
coeffQuadratic[quadSize] = ASN1OctetString.getInstance(asnCoeffQuad.getObjectAt(quadSize)).getOctets();
}
ASN1Sequence asnCoeffSing = (ASN1Sequence)seq.getObjectAt(3);
coeffSingular = new byte[asnCoeffSing.size()][];
for (int singSize = 0; singSize < asnCoeffSing.size(); singSize++)
{
coeffSingular[singSize] = ASN1OctetString.getInstance(asnCoeffSing.getObjectAt(singSize)).getOctets();
}
ASN1Sequence asnCoeffScalar = (ASN1Sequence)seq.getObjectAt(4);
coeffScalar = ASN1OctetString.getInstance(asnCoeffScalar.getObjectAt(0)).getOctets();
}
示例9: PBMParameter
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private PBMParameter(ASN1Sequence seq)
{
salt = ASN1OctetString.getInstance(seq.getObjectAt(0));
owf = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
iterationCount = ASN1Integer.getInstance(seq.getObjectAt(2));
mac = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
}
示例10: TBSRequest
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private TBSRequest(
ASN1Sequence seq)
{
int index = 0;
if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
{
ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(0);
if (o.getTagNo() == 0)
{
versionSet = true;
version = ASN1Integer.getInstance((ASN1TaggedObject)seq.getObjectAt(0), true);
index++;
}
else
{
version = V1;
}
}
else
{
version = V1;
}
if (seq.getObjectAt(index) instanceof ASN1TaggedObject)
{
requestorName = GeneralName.getInstance((ASN1TaggedObject)seq.getObjectAt(index++), true);
}
requestList = (ASN1Sequence)seq.getObjectAt(index++);
if (seq.size() == (index + 1))
{
requestExtensions = Extensions.getInstance((ASN1TaggedObject)seq.getObjectAt(index), true);
}
}
示例11: CrlIdentifier
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private CrlIdentifier(ASN1Sequence seq)
{
if (seq.size() < 2 || seq.size() > 3)
{
throw new IllegalArgumentException();
}
this.crlIssuer = X500Name.getInstance(seq.getObjectAt(0));
this.crlIssuedTime = ASN1UTCTime.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
this.crlNumber = ASN1Integer.getInstance(seq.getObjectAt(2));
}
}
示例12: CertStatus
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private CertStatus(ASN1Sequence seq)
{
certHash = ASN1OctetString.getInstance(seq.getObjectAt(0));
certReqId = ASN1Integer.getInstance(seq.getObjectAt(1));
if (seq.size() > 2)
{
statusInfo = PKIStatusInfo.getInstance(seq.getObjectAt(2));
}
}
示例13: MonetaryLimit
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private MonetaryLimit(ASN1Sequence seq)
{
if (seq.size() != 3)
{
throw new IllegalArgumentException("Bad sequence size: "
+ seq.size());
}
Enumeration e = seq.getObjects();
currency = DERPrintableString.getInstance(e.nextElement());
amount = ASN1Integer.getInstance(e.nextElement());
exponent = ASN1Integer.getInstance(e.nextElement());
}
示例14: EncryptedData
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private EncryptedData(ASN1Sequence seq)
{
this.version = ASN1Integer.getInstance(seq.getObjectAt(0));
this.encryptedContentInfo = EncryptedContentInfo.getInstance(seq.getObjectAt(1));
if (seq.size() == 3)
{
this.unprotectedAttrs = ASN1Set.getInstance(seq.getObjectAt(2));
}
}
示例15: PKCS12PBEParams
import org.bouncycastle.asn1.ASN1Integer; //導入方法依賴的package包/類
private PKCS12PBEParams(
ASN1Sequence seq)
{
iv = (ASN1OctetString)seq.getObjectAt(0);
iterations = ASN1Integer.getInstance(seq.getObjectAt(1));
}