本文整理了Java中org.spongycastle.asn1.x509.AlgorithmIdentifier.<init>()
方法的一些代码示例,展示了AlgorithmIdentifier.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AlgorithmIdentifier.<init>()
方法的具体详情如下:
包路径:org.spongycastle.asn1.x509.AlgorithmIdentifier
类名称:AlgorithmIdentifier
方法名:<init>
暂无
代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on
public AlgorithmIdentifier find(String digAlgName)
{
return new AlgorithmIdentifier((ASN1ObjectIdentifier)digestNameToOids.get(digAlgName), DERNull.INSTANCE);
}
}
代码示例来源:origin: com.madgag.spongycastle/pkix
public GenericKey getKey()
{
return new GenericKey(new AlgorithmIdentifier(algorithm, pbeParams), PKCS12ParametersGenerator.PKCS12PasswordToBytes(password));
}
};
代码示例来源:origin: com.madgag.spongycastle/core
public AlgorithmIdentifier getHashAlgorithm()
{
if (null == this.otherHash)
{
return new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1);
}
return this.otherHash.getHashAlgorithm();
}
代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on
public AlgorithmIdentifier getDigestAlgorithmIdentifier()
{
return new AlgorithmIdentifier(algorithmIdentifier.getAlgorithm(), DERNull.INSTANCE);
}
};
代码示例来源:origin: com.madgag/scprov-jdk15on
static AlgorithmIdentifier getSigAlgID(
DERObjectIdentifier sigOid)
{
if (noParams.contains(sigOid))
{
return new AlgorithmIdentifier(sigOid);
}
else
{
return new AlgorithmIdentifier(sigOid, new DERNull());
}
}
代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on
public GenericKey getKey()
{
return new GenericKey(new AlgorithmIdentifier(algorithm, pbeParams), PKCS12ParametersGenerator.PKCS12PasswordToBytes(password));
}
};
代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on
private AlgorithmIdentifier lookupDigest(String algorithm)
{
if (algorithm.endsWith("-SESS"))
{
algorithm = algorithm.substring(0, algorithm.length() - "-SESS".length());
}
if (algorithm.equals("SHA-512-256"))
{
return new AlgorithmIdentifier(NISTObjectIdentifiers.id_sha512_256, DERNull.INSTANCE);
}
return digestAlgorithmIdentifierFinder.find(algorithm);
}
代码示例来源:origin: com.madgag.spongycastle/prov
public byte[] getEncoded()
{
RainbowPublicKey key = new RainbowPublicKey(docLength, coeffquadratic, coeffsingular, coeffscalar);
AlgorithmIdentifier algorithmIdentifier = new AlgorithmIdentifier(PQCObjectIdentifiers.rainbow, DERNull.INSTANCE);
return KeyUtil.getEncodedSubjectPublicKeyInfo(algorithmIdentifier, key);
}
}
代码示例来源:origin: es.gob.afirma/afirma-crypto-core-pkcs7
/** Método que devuelve el Identificador del algoritmo.
* @param oid OID del algoritmo a idenfiticar
* @return El identificador del algoritmo formateado y listo para introducir
* en el cms. */
public static AlgorithmIdentifier makeAlgId(final String oid) {
return new AlgorithmIdentifier(new ASN1ObjectIdentifier(oid), DERNull.INSTANCE);
}
代码示例来源:origin: com.madgag.spongycastle/pkix
private static RSASSAPSSparams createPSSParams(AlgorithmIdentifier hashAlgId, int saltSize)
{
return new RSASSAPSSparams(
hashAlgId,
new AlgorithmIdentifier(PKCSObjectIdentifiers.id_mgf1, hashAlgId),
new ASN1Integer(saltSize),
new ASN1Integer(1));
}
代码示例来源:origin: com.madgag.spongycastle/prov
private static RSASSAPSSparams creatPSSParams(AlgorithmIdentifier hashAlgId, int saltSize)
{
return new RSASSAPSSparams(
hashAlgId,
new AlgorithmIdentifier(PKCSObjectIdentifiers.id_mgf1, hashAlgId),
new ASN1Integer(saltSize),
new ASN1Integer(1));
}
代码示例来源:origin: com.madgag.spongycastle/core
public AlgorithmIdentifier getAlgorithmHash()
{
if (otherCertHash.toASN1Primitive() instanceof ASN1OctetString)
{
// SHA-1
return new AlgorithmIdentifier(OIWObjectIdentifiers.idSHA1);
}
else
{
return DigestInfo.getInstance(otherCertHash).getAlgorithmId();
}
}
代码示例来源:origin: com.madgag.spongycastle/prov
public byte[] getEncoded()
{
if (dsaSpec == null)
{
return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_dsa), new ASN1Integer(y));
}
return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_dsa, new DSAParameter(dsaSpec.getP(), dsaSpec.getQ(), dsaSpec.getG()).toASN1Primitive()), new ASN1Integer(y));
}
代码示例来源:origin: com.madgag.spongycastle/bcpkix-jdk15on
public ContentVerifier getContentVerifier(AlgorithmIdentifier signingAlgorithm, AlgorithmIdentifier digestAlgorithm)
throws OperatorCreationException
{
String signatureName = sigNameGenerator.getSignatureName(digestAlgorithm, signingAlgorithm);
AlgorithmIdentifier baseAlgID = sigAlgorithmFinder.find(signatureName);
return verifierProvider.get(new AlgorithmIdentifier(baseAlgID.getAlgorithm(), signingAlgorithm.getParameters()));
}
代码示例来源:origin: com.madgag/scprov-jdk15on
/**
* Return a PKCS8 representation of the key. The sequence returned
* represents a full PrivateKeyInfo object.
*
* @return a PKCS8 representation of the key.
*/
public byte[] getEncoded()
{
return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalParameter(elSpec.getP(), elSpec.getG())), new DERInteger(getX()));
}
代码示例来源:origin: com.madgag.spongycastle/prov
public byte[] getEncoded()
{
if (info != null)
{
return KeyUtil.getEncodedSubjectPublicKeyInfo(info);
}
return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, new DHParameter(dhSpec.getP(), dhSpec.getG(), dhSpec.getL())), new ASN1Integer(y));
}
代码示例来源:origin: com.madgag/scprov-jdk15on
public byte[] getEncoded()
{
if (info != null)
{
return KeyUtil.getEncodedSubjectPublicKeyInfo(info);
}
return KeyUtil.getEncodedSubjectPublicKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.dhKeyAgreement, new DHParameter(dhSpec.getP(), dhSpec.getG(), dhSpec.getL())), new DERInteger(y));
}
代码示例来源:origin: com.madgag/scprov-jdk15on
/**
* Return a PKCS8 representation of the key. The sequence returned
* represents a full PrivateKeyInfo object.
*
* @return a PKCS8 representation of the key.
*/
public byte[] getEncoded()
{
return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(X9ObjectIdentifiers.id_dsa, new DSAParameter(dsaSpec.getP(), dsaSpec.getQ(), dsaSpec.getG()).toASN1Primitive()), new ASN1Integer(getX()));
}
代码示例来源:origin: com.madgag/scprov-jdk15on
/**
* Return a PKCS8 representation of the key. The sequence returned
* represents a full PrivateKeyInfo object.
*
* @return a PKCS8 representation of the key.
*/
public byte[] getEncoded()
{
return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, new DERNull()), new RSAPrivateKey(getModulus(), getPublicExponent(), getPrivateExponent(), getPrimeP(), getPrimeQ(), getPrimeExponentP(), getPrimeExponentQ(), getCrtCoefficient()));
}
代码示例来源:origin: com.madgag/scprov-jdk15on
/**
* Return a PKCS8 representation of the key. The sequence returned
* represents a full PrivateKeyInfo object.
*
* @return a PKCS8 representation of the key.
*/
public byte[] getEncoded()
{
return KeyUtil.getEncodedPrivateKeyInfo(new AlgorithmIdentifier(PKCSObjectIdentifiers.rsaEncryption, new DERNull()), new RSAPrivateKey(getModulus(), getPublicExponent(), getPrivateExponent(), getPrimeP(), getPrimeQ(), getPrimeExponentP(), getPrimeExponentQ(), getCrtCoefficient()));
}
内容来源于网络,如有侵权,请联系作者删除!