/** * return the X9ECParameters object for the named curve represented by * the passed in object identifier. Null if the curve isn't present. * * @param oid an object identifier representing a named curve, if present. */ public static X9ECParameters getByOID( ASN1ObjectIdentifier oid) { return SECNamedCurves.getByOID(oid); }
public DERBitString getPublicKey() { return (DERBitString)getObjectInTag(1); }
/** * Always treat de-serialization as a full-blown constructor, by * validating the final state of the de-serialized object. */ private void readObject(ObjectInputStream aInputStream) throws ClassNotFoundException, IOException { //always perform the default de-serialization first aInputStream.defaultReadObject(); X9ECParameters CURVEparams = SECNamedCurves.getByName("secp256k1"); this.CURVE = new ECDomainParameters(CURVEparams.getCurve(), CURVEparams.getG(), CURVEparams.getN(), CURVEparams.getH()); }
/** * 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(); }
public ASN1Primitive getParameters() { return getObjectInTag(0); }
public static String getCurveName(final ASN1ObjectIdentifier curveOid) { ParamUtil.requireNonNull("curveOid", curveOid); String curveName = X962NamedCurves.getName(curveOid); if (curveName == null) { curveName = SECNamedCurves.getName(curveOid); } if (curveName == null) { curveName = TeleTrusTNamedCurves.getName(curveOid); } if (curveName == null) { curveName = NISTNamedCurves.getName(curveOid); } return curveName; }
public static ECPrivateKey getInstance( Object obj) { if (obj instanceof ECPrivateKey) { return (ECPrivateKey)obj; } if (obj != null) { return new ECPrivateKey(ASN1Sequence.getInstance(obj)); } return null; }
/** * Always treat de-serialization as a full-blown constructor, by * validating the final state of the de-serialized object. */ private void readObject(ObjectInputStream aInputStream) throws ClassNotFoundException, IOException { //always perform the default de-serialization first aInputStream.defaultReadObject(); X9ECParameters CURVEparams = SECNamedCurves.getByName("secp256k1"); this.CURVE = new ECDomainParameters(CURVEparams.getCurve(), CURVEparams.getG(), CURVEparams.getN(), CURVEparams.getH()); }
/** * return the X9ECParameters object for the named curve represented by * the passed in object identifier. Null if the curve isn't present. * * @param oid an object identifier representing a named curve, if present. */ public static X9ECParameters getByOID( ASN1ObjectIdentifier oid) { return SECNamedCurves.getByOID(oid); }
public DERBitString getPublicKey() { return (DERBitString)getObjectInTag(1); }
public DERBitString getPublicKey() { return (DERBitString)getObjectInTag(1); }
public static ECPrivateKey getInstance( Object obj) { if (obj instanceof ECPrivateKey) { return (ECPrivateKey)obj; } if (obj != null) { return new ECPrivateKey(ASN1Sequence.getInstance(obj)); } return null; }
public static AsymmetricCipherKeyPair generateECPublicKey() { // Should we also generate random curves? X9ECParameters ecp = SECNamedCurves.getByName(getRandomCurveName()); ECKeyPairGenerator keygen = new ECKeyPairGenerator(); ECDomainParameters domainParams = new ECDomainParameters(ecp.getCurve(), ecp.getG(), ecp.getN(), ecp.getH(), ecp.getSeed()); keygen.init(new ECKeyGenerationParameters(domainParams, RandomHelper.getBadSecureRandom())); return keygen.generateKeyPair(); }
public static X9ECParameters getByName( String name) { ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)objIds.get(Strings.toLowerCase(name)); if (oid != null) { return getByOID(oid); } return null; }
public ASN1Primitive getParameters() { return getObjectInTag(0); }
public DERBitString getPublicKey() { return (DERBitString)getObjectInTag(1); }
/** * return a X9ECParameters object representing the passed in named * curve. * * @param oid the object id of the curve requested * @return an X9ECParameters object or null if the curve is not available. */ public static X9ECParameters getByOID( ASN1ObjectIdentifier oid) { X9ECParameters ecP = X962NamedCurves.getByOID(oid); if (ecP == null) { ecP = SECNamedCurves.getByOID(oid); } if (ecP == null) { ecP = TeleTrusTNamedCurves.getByOID(oid); } // NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup return ecP; }
public ASN1Primitive getParameters() { return getObjectInTag(0); }
public ASN1Primitive getParameters() { return getObjectInTag(0); }