本文整理汇总了Java中org.bouncycastle.asn1.nist.NISTNamedCurves类的典型用法代码示例。如果您正苦于以下问题:Java NISTNamedCurves类的具体用法?Java NISTNamedCurves怎么用?Java NISTNamedCurves使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NISTNamedCurves类属于org.bouncycastle.asn1.nist包,在下文中一共展示了NISTNamedCurves类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getByName
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return a X9ECParameters object representing the passed in named
* curve. The routine returns null if the curve is not present.
*
* @param name the name of the curve requested
* @return an X9ECParameters object or null if the curve is not available.
*/
public static X9ECParameters getByName(
String name)
{
X9ECParameters ecP = X962NamedCurves.getByName(name);
if (ecP == null)
{
ecP = SECNamedCurves.getByName(name);
}
if (ecP == null)
{
ecP = TeleTrusTNamedCurves.getByName(name);
}
if (ecP == null)
{
ecP = NISTNamedCurves.getByName(name);
}
return ecP;
}
示例2: getNamedCurveOid
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
public static ASN1ObjectIdentifier getNamedCurveOid(
String name)
{
ASN1ObjectIdentifier oid = X962NamedCurves.getOID(name);
if (oid == null)
{
oid = SECNamedCurves.getOID(name);
if (oid == null)
{
oid = NISTNamedCurves.getOID(name);
}
if (oid == null)
{
oid = TeleTrusTNamedCurves.getOID(name);
}
if (oid == null)
{
oid = ECGOST3410NamedCurves.getOID(name);
}
}
return oid;
}
示例3: getNamedCurveByOid
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
public static X9ECParameters getNamedCurveByOid(
ASN1ObjectIdentifier oid)
{
X9ECParameters params = X962NamedCurves.getByOID(oid);
if (params == null)
{
params = SECNamedCurves.getByOID(oid);
if (params == null)
{
params = NISTNamedCurves.getByOID(oid);
}
if (params == null)
{
params = TeleTrusTNamedCurves.getByOID(oid);
}
}
return params;
}
示例4: getCurveName
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
public static String getCurveName(
ASN1ObjectIdentifier oid)
{
String name = X962NamedCurves.getName(oid);
if (name == null)
{
name = SECNamedCurves.getName(oid);
if (name == null)
{
name = NISTNamedCurves.getName(oid);
}
if (name == null)
{
name = TeleTrusTNamedCurves.getName(oid);
}
if (name == null)
{
name = ECGOST3410NamedCurves.getName(oid);
}
}
return name;
}
示例5: getNamedCurveByOid
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
public static X9ECParameters getNamedCurveByOid(
ASN1ObjectIdentifier oid)
{
X9ECParameters params = CustomNamedCurves.getByOID(oid);
if (params == null)
{
params = X962NamedCurves.getByOID(oid);
if (params == null)
{
params = SECNamedCurves.getByOID(oid);
}
if (params == null)
{
params = NISTNamedCurves.getByOID(oid);
}
if (params == null)
{
params = TeleTrusTNamedCurves.getByOID(oid);
}
}
return params;
}
示例6: getNamedCurveByName
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
public static X9ECParameters getNamedCurveByName(
String curveName)
{
X9ECParameters params = CustomNamedCurves.getByName(curveName);
if (params == null)
{
params = X962NamedCurves.getByName(curveName);
if (params == null)
{
params = SECNamedCurves.getByName(curveName);
}
if (params == null)
{
params = NISTNamedCurves.getByName(curveName);
}
if (params == null)
{
params = TeleTrusTNamedCurves.getByName(curveName);
}
}
return params;
}
示例7: getOID
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return the object identifier signified by the passed in name. Null
* if there is no object identifier associated with name.
*
* @return the object identifier associated with name, if present.
*/
public static ASN1ObjectIdentifier getOID(
String name)
{
ASN1ObjectIdentifier oid = X962NamedCurves.getOID(name);
if (oid == null)
{
oid = SECNamedCurves.getOID(name);
}
if (oid == null)
{
oid = TeleTrusTNamedCurves.getOID(name);
}
if (oid == null)
{
oid = NISTNamedCurves.getOID(name);
}
return oid;
}
示例8: curveTest
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
@Test
public void curveTest() {
final X9ECParameters curve = NISTNamedCurves.getByName("P-384");
final ECDomainParameters domainParameters = new ECDomainParameters(
curve.getCurve(), curve.getG(), curve.getN());
final SecureRandom random = new SecureRandom();
final ECKeyPairGenerator gen = new ECKeyPairGenerator();
gen.init(new ECKeyGenerationParameters(domainParameters, random));
final AsymmetricCipherKeyPair senderPair = gen.generateKeyPair();
final AsymmetricCipherKeyPair receiverPair = gen.generateKeyPair();
final ECDHBasicAgreement senderAgreement = new ECDHBasicAgreement();
senderAgreement.init(senderPair.getPrivate());
final BigInteger senderResult = senderAgreement.calculateAgreement(
receiverPair.getPublic());
final ECDHBasicAgreement receiverAgreement = new ECDHBasicAgreement();
receiverAgreement.init(receiverPair.getPrivate());
final BigInteger receiverResult = receiverAgreement.calculateAgreement(
senderPair.getPublic());
assertEquals(senderResult, receiverResult);
//System.out.println(receiverResult);
}
示例9: curveTest
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
@Test
public void curveTest() {
final X9ECParameters curve = NISTNamedCurves.getByName("P-384");
final ECDomainParameters domainParameters = new ECDomainParameters(
curve.getCurve(), curve.getG(), curve.getN());
final SecureRandom random = new SecureRandom();
final ECKeyPairGenerator gen = new ECKeyPairGenerator();
gen.init(new ECKeyGenerationParameters(domainParameters, random));
final AsymmetricCipherKeyPair senderPair = gen.generateKeyPair();
final ECDSASigner signer = new ECDSASigner();
signer.init(true, senderPair.getPrivate());
final byte[] message = "The magic words are squeamish ossifrage".getBytes(
Constants.ASCII);
final SHA384Digest digester = new SHA384Digest();
digester.update(message, 0, message.length);
final byte[] digest = new byte[digester.getDigestSize()];
digester.doFinal(digest, 0);
final BigInteger[] signature = signer.generateSignature(digest);
final ECDSASigner verifier = new ECDSASigner();
verifier.init(false, senderPair.getPublic());
assertTrue(verifier.verifySignature(digest, signature[0], signature[1]));
}
示例10: getNames
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return an enumeration of the names of the available curves.
*
* @return an enumeration of the names of the available curves.
*/
public static Enumeration getNames()
{
Vector v = new Vector();
addEnumeration(v, X962NamedCurves.getNames());
addEnumeration(v, SECNamedCurves.getNames());
addEnumeration(v, NISTNamedCurves.getNames());
addEnumeration(v, TeleTrusTNamedCurves.getNames());
return v.elements();
}
示例11: getNames
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return an enumeration of the names of the available curves.
*
* @return an enumeration of the names of the available curves.
*/
public static Enumeration getNames()
{
Vector v = new Vector();
addEnumeration(v, X962NamedCurves.getNames());
addEnumeration(v, SECNamedCurves.getNames());
addEnumeration(v, NISTNamedCurves.getNames());
addEnumeration(v, TeleTrusTNamedCurves.getNames());
return v.elements();
}
示例12: getByName
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return a X9ECParameters object representing the passed in named
* curve. The routine returns null if the curve is not present.
*
* @param name the name of the curve requested
* @return an X9ECParameters object or null if the curve is not available.
*/
public static X9ECParameters getByName(
String name)
{
X9ECParameters ecP = X962NamedCurves.getByName(name);
if (ecP == null)
{
ecP = SECNamedCurves.getByName(name);
}
if (ecP == null)
{
ecP = NISTNamedCurves.getByName(name);
}
if (ecP == null)
{
ecP = TeleTrusTNamedCurves.getByName(name);
}
if (ecP == null)
{
ecP = ANSSINamedCurves.getByName(name);
}
return ecP;
}
示例13: getOID
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return the object identifier signified by the passed in name. Null
* if there is no object identifier associated with name.
*
* @return the object identifier associated with name, if present.
*/
public static ASN1ObjectIdentifier getOID(
String name)
{
ASN1ObjectIdentifier oid = X962NamedCurves.getOID(name);
if (oid == null)
{
oid = SECNamedCurves.getOID(name);
}
if (oid == null)
{
oid = NISTNamedCurves.getOID(name);
}
if (oid == null)
{
oid = TeleTrusTNamedCurves.getOID(name);
}
if (oid == null)
{
oid = ANSSINamedCurves.getOID(name);
}
return oid;
}
示例14: getName
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return a X9ECParameters object representing the passed in named
* curve.
*
* @param oid the object id of the curve requested
* @return a standard name for the curve.
*/
public static String getName(
ASN1ObjectIdentifier oid)
{
String name = NISTNamedCurves.getName(oid);
if (name == null)
{
name = SECNamedCurves.getName(oid);
}
if (name == null)
{
name = TeleTrusTNamedCurves.getName(oid);
}
if (name == null)
{
name = X962NamedCurves.getName(oid);
}
if (name == null)
{
name = ECGOST3410NamedCurves.getName(oid);
}
return name;
}
示例15: getNames
import org.bouncycastle.asn1.nist.NISTNamedCurves; //导入依赖的package包/类
/**
* return an enumeration of the names of the available curves.
*
* @return an enumeration of the names of the available curves.
*/
public static Enumeration getNames()
{
Vector v = new Vector();
addEnumeration(v, X962NamedCurves.getNames());
addEnumeration(v, SECNamedCurves.getNames());
addEnumeration(v, NISTNamedCurves.getNames());
addEnumeration(v, TeleTrusTNamedCurves.getNames());
addEnumeration(v, ANSSINamedCurves.getNames());
return v.elements();
}