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

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

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

ASN1Integer.getValue介绍

暂无

代码示例

代码示例来源:origin: hyperledger/fabric-sdk-java

if (asn1Primitive instanceof ASN1Integer) {
  ASN1Integer asn1Integer = (ASN1Integer) asn1Primitive;
  BigInteger integer = asn1Integer.getValue();
  if (count < 2) {
    sigs[count] = integer;

代码示例来源:origin: apache/pdfbox

private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0)
  throws IOException, CertificateEncodingException, InvalidKeyException,
    BadPaddingException, IllegalBlockSizeException
{
  TBSCertificate certificate;
  try (ASN1InputStream input = new ASN1InputStream(x509certificate.getTBSCertificate()))
  {
    certificate = TBSCertificate.getInstance(input.readObject());
  }
  AlgorithmIdentifier algorithmId = certificate.getSubjectPublicKeyInfo().getAlgorithm();
  IssuerAndSerialNumber serial = new IssuerAndSerialNumber(
      certificate.getIssuer(),
      certificate.getSerialNumber().getValue());
  Cipher cipher;
  try
  {
    cipher = Cipher.getInstance(algorithmId.getAlgorithm().getId(),
        SecurityProvider.getProvider());
  }
  catch (NoSuchAlgorithmException | NoSuchPaddingException e)
  {
    // should never happen, if this happens throw IOException instead
    throw new RuntimeException("Could not find a suitable javax.crypto provider", e);
  }
  cipher.init(1, x509certificate.getPublicKey());
  DEROctetString octets = new DEROctetString(cipher.doFinal(abyte0));
  RecipientIdentifier recipientId = new RecipientIdentifier(serial);
  return new KeyTransRecipientInfo(recipientId, algorithmId, octets);
}

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

public BigInteger getMinimum()
{
  if (minimum == null)
  {
    return ZERO;
  }
  return minimum.getValue();
}

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

public BigInteger getMaximum()
{
  if (maximum == null)
  {
    return null;
  }
  return maximum.getValue();
}

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

public BigInteger getAuthorityCertSerialNumber()
{
  if (certserno != null)
  {
    return certserno.getValue();
  }
  
  return null;
}

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

public BigInteger getCrlNumber()
{
  if (null == this.crlNumber)
  {
    return null;
  }
  return this.crlNumber.getValue();
}

代码示例来源: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

private McEliecePublicKey(ASN1Sequence seq)
{
  BigInteger bigN = ((ASN1Integer)seq.getObjectAt(0)).getValue();
  n = bigN.intValue();
  BigInteger bigT = ((ASN1Integer)seq.getObjectAt(1)).getValue();
  t = bigT.intValue();
  g = new GF2Matrix(((ASN1OctetString)seq.getObjectAt(2)).getOctets());
}

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

private EncryptedData(
  ASN1Sequence seq)
{
  int version = ((ASN1Integer)seq.getObjectAt(0)).getValue().intValue();
  if (version != 0)
  {
    throw new IllegalArgumentException("sequence not version 0");
  }
  this.data = ASN1Sequence.getInstance(seq.getObjectAt(1));
}

代码示例来源: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: horrorho/InflatableDonkey

public NOS(ASN1Primitive primitive) {
  DERIterator i = DER.asSequence(primitive);
  x = DER.as(ASN1Integer.class, i)
      .getValue()
      .intValue();
  y = i.nextIf(ASN1Integer.class)
      .map(ASN1Integer::getValue)
      .map(BigInteger::intValue);
  key = DER.as(DEROctetString.class, i)
      .getOctets();
}

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

private McElieceCCA2PublicKey(ASN1Sequence seq)
{
  BigInteger bigN = ((ASN1Integer)seq.getObjectAt(0)).getValue();
  n = bigN.intValue();
  BigInteger bigT = ((ASN1Integer)seq.getObjectAt(1)).getValue();
  t = bigT.intValue();
  g = new GF2Matrix(((ASN1OctetString)seq.getObjectAt(2)).getOctets());
  digest = AlgorithmIdentifier.getInstance(seq.getObjectAt(3));
}

代码示例来源:origin: horrorho/InflatableDonkey

public SignatureInfo(ASN1Primitive primitive) {
  DERIterator i = DER.asSequence(primitive);
  DERIterator j = DER.asSequence(i);
  version = DER.as(ASN1Integer.class, j)
      .getValue()
      .intValue();
  info = DER.as(DEROctetString.class, j)
      .getOctets();
}

代码示例来源: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 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: org.bouncycastle/bcprov-debug-jdk15on

AsymmetricKeyParameter getPublicKeyParameters(SubjectPublicKeyInfo keyInfo, Object defaultParams)
    throws IOException
  {
    DHParameter params = DHParameter.getInstance(keyInfo.getAlgorithm().getParameters());
    ASN1Integer derY = (ASN1Integer)keyInfo.parsePublicKey();
    BigInteger lVal = params.getL();
    int l = lVal == null ? 0 : lVal.intValue();
    DHParameters dhParams = new DHParameters(params.getP(), params.getG(), null, l);
    return new DHPublicKeyParameters(derY.getValue(), dhParams);
  }
}

代码示例来源: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;
}

相关文章