org.bouncycastle.asn1.x509.AlgorithmIdentifier.getObjectId()方法的使用及代码示例

x33g5p2x  于10个月前 转载在 其他  
字(7.5k)|赞(0)|评价(0)|浏览(41)

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

AlgorithmIdentifier.getObjectId介绍

暂无

代码示例

代码示例来源:origin: com.google.code.jscep/jscep-api

/**
 * Returns the name of the given algorithm.
 * 
 * @param alg the algorithm to look up.
 * @return the algorithm name.
 */
public static String lookup(AlgorithmIdentifier alg) {
  return contents.get(alg.getObjectId());
}

代码示例来源:origin: stackoverflow.com

SecretKeySpec keySpec = new SecretKeySpec(rawKey, algoID.getObjectId().getId());
Cipher c = Cipher.getInstance(algoID.getObjectId().getId(), CRYPT_PROVIDER);

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

private KeyTransRecipientInfo computeRecipientInfo(X509Certificate x509certificate, byte[] abyte0)
    throws GeneralSecurityException, IOException
  {
    ASN1InputStream asn1inputstream = 
      new ASN1InputStream(new ByteArrayInputStream(x509certificate.getTBSCertificate()));
    TBSCertificateStructure tbscertificatestructure = 
      TBSCertificateStructure.getInstance(asn1inputstream.readObject());
    AlgorithmIdentifier algorithmidentifier = tbscertificatestructure.getSubjectPublicKeyInfo().getAlgorithmId();
    IssuerAndSerialNumber issuerandserialnumber = 
      new IssuerAndSerialNumber(
        tbscertificatestructure.getIssuer(), 
        tbscertificatestructure.getSerialNumber().getValue());
    Cipher cipher = Cipher.getInstance(algorithmidentifier.getObjectId().getId());        
    cipher.init(1, x509certificate);
    DEROctetString deroctetstring = new DEROctetString(cipher.doFinal(abyte0));
    RecipientIdentifier recipId = new RecipientIdentifier(issuerandserialnumber);
    return new KeyTransRecipientInfo( recipId, algorithmidentifier, deroctetstring);
  }
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

private KeyTransRecipientInfo computeRecipientInfo(final X509Certificate x509certificate, final byte[] abyte0)
    throws GeneralSecurityException, IOException
  {
    final ASN1InputStream asn1inputstream =
      new ASN1InputStream(new ByteArrayInputStream(x509certificate.getTBSCertificate()));
    final TBSCertificateStructure tbscertificatestructure =
      TBSCertificateStructure.getInstance(asn1inputstream.readObject());
    final AlgorithmIdentifier algorithmidentifier = tbscertificatestructure.getSubjectPublicKeyInfo().getAlgorithmId();
    final IssuerAndSerialNumber issuerandserialnumber =
      new IssuerAndSerialNumber(
        tbscertificatestructure.getIssuer(),
        tbscertificatestructure.getSerialNumber().getValue());
    final Cipher cipher = Cipher.getInstance(algorithmidentifier.getObjectId().getId());
    cipher.init(1, x509certificate);
    final DEROctetString deroctetstring = new DEROctetString(cipher.doFinal(abyte0));
    final RecipientIdentifier recipId = new RecipientIdentifier(issuerandserialnumber);
    return new KeyTransRecipientInfo( recipId, algorithmidentifier, deroctetstring);
  }
}

代码示例来源:origin: be.fedict.eid-applet/eid-applet-service

DigestInfo signatureDigestInfo = new DigestInfo((ASN1Sequence) aIn.readObject());
if (false == PLAIN_TEXT_DIGEST_ALGO_OID
    .equals(signatureDigestInfo.getAlgorithmId().getObjectId().getId())) {
  throw new SecurityException("TransactionMessage signature algo OID incorrect");

代码示例来源:origin: DirectProject/nhin-d

/**
 * {@inheritDoc}
 */
@Override
public void injectReferenceValue(X509Certificate value) throws PolicyProcessException 
{
  this.certificate = value;
  
  DERObject tbsValue = null;
  
  try
  {
    tbsValue = this.getDERObject(certificate.getTBSCertificate());
  }
  ///CLOVER:OFF
  catch (Exception e)
  {
    throw new PolicyProcessException("Exception parsing TBS certificate fields.", e);
  }
  ///CLOVER:ON
  
  final TBSCertificateStructure tbsStruct = TBSCertificateStructure.getInstance(tbsValue);
  this.policyValue = PolicyValueFactory.getInstance(tbsStruct.getSubjectPublicKeyInfo().
      getAlgorithmId().getObjectId().toString());
}

代码示例来源:origin: br.gov.frameworkdemoiselle.component/demoiselle-certificate-signer

byte[] hashContentSigned = octeto.getOctets();
String algorithm = SignerAlgorithmEnum.getSignerOIDAlgorithmHashEnum(signerInformation.getDigestAlgorithmID().getObjectId().toString()).getAlgorithmHash();
if (!(DigestAlgorithmEnum.SHA_256.getAlgorithm().equalsIgnoreCase(algorithm) || DigestAlgorithmEnum.SHA_512.getAlgorithm().equalsIgnoreCase(algorithm))) {
  throw new SignerException("Algoritmo de resumo inválido para esta política");

代码示例来源:origin: br.gov.frameworkdemoiselle.component/demoiselle-certificate-signer

byte[] hashContentSigned = octeto.getOctets();
String algorithm = SignerAlgorithmEnum.getSignerOIDAlgorithmHashEnum(signerInformation.getDigestAlgorithmID().getObjectId().toString()).getAlgorithmHash();
if (!algorithm.equals(DigestAlgorithmEnum.SHA_256.getAlgorithm())) {
  throw new SignerException("Algoritmo de resumo inválido para esta política");

代码示例来源:origin: br.gov.frameworkdemoiselle.component/demoiselle-certificate-signer

byte[] hashContentSigned = octeto.getOctets();
String algorithm = SignerAlgorithmEnum.getSignerOIDAlgorithmHashEnum(signerInformation.getDigestAlgorithmID().getObjectId().toString()).getAlgorithmHash();
if (!algorithm.equals(DigestAlgorithmEnum.SHA_256.getAlgorithm())) {
  throw new SignerException("Algoritmo de resumo inválido para esta política");

代码示例来源:origin: edu.vt.middleware/vt-crypt

final String algOid = pi.getAlgorithmId().getObjectId().getId();
if (RSA_ID.equals(pi.getAlgorithmId().getObjectId())) {
 algorithm = "RSA";
} else if (EC_ID.equals(pi.getAlgorithmId().getObjectId())) {
 algorithm = "EC";
} else if (DSA_ID.equals(pi.getAlgorithmId().getObjectId())) {
 algorithm = "DSA";
} else {

代码示例来源:origin: edu.vt.middleware/vt-crypt

ASN1Object.fromByteArray(encrypted));
final AlgorithmIdentifier alg = ki.getEncryptionAlgorithm();
if (PKCSObjectIdentifiers.id_PBES2.equals(alg.getObjectId())) {
  PBES1Algorithm.fromOid(alg.getObjectId().getId()),
  PBEParameter.decode((DERSequence) alg.getParameters()));

代码示例来源:origin: br.gov.frameworkdemoiselle.component/demoiselle-certificate-signer

byte[] hashContentSigned = octeto.getOctets();
String algorithm = SignerAlgorithmEnum.getSignerOIDAlgorithmHashEnum(signerInformation.getDigestAlgorithmID().getObjectId().toString()).getAlgorithmHash();
if (!algorithm.equals(DigestAlgorithmEnum.SHA_1.getAlgorithm())) {
  throw new SignerException("Algoritmo de resumo inválido para esta política");

代码示例来源:origin: br.gov.frameworkdemoiselle.component/demoiselle-certificate-signer

byte[] hashContentSigned = octeto.getOctets();
String algorithm = SignerAlgorithmEnum.getSignerOIDAlgorithmHashEnum(signerInformation.getDigestAlgorithmID().getObjectId().toString()).getAlgorithmHash();
if (!algorithm.equals(DigestAlgorithmEnum.SHA_1.getAlgorithm()) && !algorithm.equals(DigestAlgorithmEnum.SHA_256.getAlgorithm())) {
  throw new SignerException("Algoritmo de resumo inválido para esta política");

代码示例来源:origin: com.hynnet/jradius-extended

if (algId.getObjectId().equals(PKCSObjectIdentifiers.rsaEncryption))
                keyStructure.getCoefficient());
else if (algId.getObjectId().equals(PKCSObjectIdentifiers.dhKeyAgreement))
else if (algId.getObjectId().equals(OIWObjectIdentifiers.elGamalAlgorithm))
else if (algId.getObjectId().equals(X9ObjectIdentifiers.id_dsa))
else if (algId.getObjectId().equals(X9ObjectIdentifiers.id_ecPublicKey))

代码示例来源:origin: net.jradius/jradius-extended

if (algId.getObjectId().equals(PKCSObjectIdentifiers.rsaEncryption))
                keyStructure.getCoefficient());
else if (algId.getObjectId().equals(PKCSObjectIdentifiers.dhKeyAgreement))
else if (algId.getObjectId().equals(OIWObjectIdentifiers.elGamalAlgorithm))
else if (algId.getObjectId().equals(X9ObjectIdentifiers.id_dsa))
else if (algId.getObjectId().equals(X9ObjectIdentifiers.id_ecPublicKey))

相关文章