org.bouncycastle.asn1.ASN1Integer.getInstance()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.bouncycastle.asn1.ASN1Integer.getInstance()方法的一些代码示例,展示了ASN1Integer.getInstance()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ASN1Integer.getInstance()方法的具体详情如下:
包路径:org.bouncycastle.asn1.ASN1Integer
类名称:ASN1Integer
方法名:getInstance

ASN1Integer.getInstance介绍

[英]return an integer from the passed in object
[中]从传入的对象返回一个整数

代码示例

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public PKIStatusInfo(
  PKIStatus      status,
  PKIFreeText    statusString,
  PKIFailureInfo failInfo)
{
  this.status = ASN1Integer.getInstance(status.toASN1Primitive());
  this.statusString = statusString;
  this.failInfo = failInfo;
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private DSAParameter(
  ASN1Sequence  seq)
{
  if (seq.size() != 3)
  {
    throw new IllegalArgumentException("Bad sequence size: " + seq.size());
  }
  
  Enumeration     e = seq.getObjects();
  p = ASN1Integer.getInstance(e.nextElement());
  q = ASN1Integer.getInstance(e.nextElement());
  g = ASN1Integer.getInstance(e.nextElement());
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public EnvelopedDataParser(
  ASN1SequenceParser seq)
  throws IOException
{
  this._seq = seq;
  this._version = ASN1Integer.getInstance(seq.readObject());
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private MonetaryValue(
  ASN1Sequence seq)
{
  Enumeration e = seq.getObjects();    
  // currency
  currency = Iso4217CurrencyCode.getInstance(e.nextElement());
  // hashAlgorithm
  amount = ASN1Integer.getInstance(e.nextElement());
  // exponent
  exponent = ASN1Integer.getInstance(e.nextElement());            
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public AuthenticatedDataParser(
  ASN1SequenceParser seq)
  throws IOException
{
  this.seq = seq;
  this.version = ASN1Integer.getInstance(seq.readObject());
}

代码示例来源:origin: org.xipki/security

private static BigInteger getInteger(ASN1Encodable object) throws BadAsn1ObjectException {
 try {
  return ASN1Integer.getInstance(object).getValue();
 } catch (IllegalArgumentException ex) {
  throw new BadAsn1ObjectException("invalid object ASN1Integer: " + ex.getMessage(), ex);
 }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

/**
 * @return notYoungerThan if that's what we are, -1 otherwise
 */
public int notYoungerThan()
{
  if (declaration.getTagNo() != 0)
  {
    return -1;
  }
  return ASN1Integer.getInstance(declaration, false).getValue().intValue();
}

代码示例来源:origin: org.xipki.p11proxy/p11proxy-common

public static BigInteger getInteger(ASN1Encodable object) throws BadAsn1ObjectException {
 try {
  return ASN1Integer.getInstance(object).getValue();
 } catch (IllegalArgumentException ex) {
  throw new BadAsn1ObjectException("invalid object ASN1Integer: " + ex.getMessage(), ex);
 }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public ASN1Integer[] toASN1IntegerArray()
{
  ASN1Integer[] result = new ASN1Integer[content.size()];
  for (int i = 0; i != result.length; i++)
  {
    result[i] = ASN1Integer.getInstance(content.getObjectAt(i));
  }
  return result;
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private XMSSKeyParams(ASN1Sequence sequence)
{
  this.version = ASN1Integer.getInstance(sequence.getObjectAt(0));
  this.height = ASN1Integer.getInstance(sequence.getObjectAt(1)).getValue().intValue();
  this.treeDigest = AlgorithmIdentifier.getInstance(sequence.getObjectAt(2));
}

代码示例来源:origin: kaikramer/keystore-explorer

private DSAPublicKey decodeDsaPublicKeyFromBitString(DERBitString der, BigInteger p, BigInteger q, BigInteger g)
    throws SpkacException {
  try {
    BigInteger y = ASN1Integer.getInstance(der.getBytes()).getValue();
    KeyFactory keyFact = KeyFactory.getInstance("DSA");
    return (DSAPublicKey) keyFact.generatePublic(new DSAPublicKeySpec(y, p, q, g));
  } catch (GeneralSecurityException ex) {
    throw new SpkacException(res.getString("NoGenerateDsaPublicKeyFromSpkac.exception.message"), ex);
  } catch (Exception ex) {
    throw new SpkacException(res.getString("NoGenerateDsaPublicKeyFromSpkac.exception.message"), ex);
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

public AuthEnvelopedDataParser(ASN1SequenceParser seq) throws IOException
{
  this.seq = seq;
  // "It MUST be set to 0."
  this.version = ASN1Integer.getInstance(seq.readObject());
  if (this.version.getValue().intValue() != 0)
  {
    throw new ASN1ParsingException("AuthEnvelopedData version number must be 0");
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private GetCert(ASN1Sequence seq)
{
  if (seq.size() != 2)
  {
    throw new IllegalArgumentException("incorrect sequence size");
  }
  this.issuerName = GeneralName.getInstance(seq.getObjectAt(0));
  this.serialNumber = ASN1Integer.getInstance(seq.getObjectAt(1)).getValue();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private DHValidationParms(ASN1Sequence seq)
{
  if (seq.size() != 2)
  {
    throw new IllegalArgumentException("Bad sequence size: " + seq.size());
  }
  this.seed = DERBitString.getInstance(seq.getObjectAt(0));
  this.pgenCounter = ASN1Integer.getInstance(seq.getObjectAt(1));
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private SinglePubInfo(ASN1Sequence seq)
{
  pubMethod = ASN1Integer.getInstance(seq.getObjectAt(0));
  if (seq.size() == 2)
  {
    pubLocation = GeneralName.getInstance(seq.getObjectAt(1));
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private PublishTrustAnchors(ASN1Sequence seq)
{
  if (seq.size() != 3)
  {
    throw new IllegalArgumentException("incorrect sequence size");
  }
  this.seqNumber = ASN1Integer.getInstance(seq.getObjectAt(0));
  this.hashAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1));
  this.anchorHashes = ASN1Sequence.getInstance(seq.getObjectAt(2));
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private GMSSPublicKey(ASN1Sequence seq)
{
  if (seq.size() != 2)
  {
    throw new IllegalArgumentException("size of seq = " + seq.size());
  }
  this.version = ASN1Integer.getInstance(seq.getObjectAt(0));
  this.publicKey = ASN1OctetString.getInstance(seq.getObjectAt(1)).getOctets();
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

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((ASN1TaggedObject)seq.getObjectAt(2), false);
  }
}

代码示例来源:origin: redfish64/TinyTravelTracker

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));
  }
}

代码示例来源:origin: org.bouncycastle/bcprov-debug-jdk15on

private ObjectData(ASN1Sequence seq)
{
  this.type = ASN1Integer.getInstance(seq.getObjectAt(0)).getValue();
  this.identifier = DERUTF8String.getInstance(seq.getObjectAt(1)).getString();
  this.creationDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(2));
  this.lastModifiedDate = ASN1GeneralizedTime.getInstance(seq.getObjectAt(3));
  this.data = ASN1OctetString.getInstance(seq.getObjectAt(4));
  this.comment = (seq.size() == 6) ? DERUTF8String.getInstance(seq.getObjectAt(5)).getString() : null;
}

相关文章