Tabnine Logo
SECNamedCurves
Code IndexAdd Tabnine to your IDE (free)

How to use
SECNamedCurves
in
org.spongycastle.asn1.sec

Best Java code snippets using org.spongycastle.asn1.sec.SECNamedCurves (Showing top 20 results out of 315)

origin: com.madgag.spongycastle/core

/**
 * 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);
}
origin: com.madgag.spongycastle/core

public static X9ECParameters getByName(
  String name)
{
  ASN1ObjectIdentifier oid = getOID(name);
  return oid == null ? null : getByOID(oid);
}
origin: com.google/bitcoinj

/**
 * Output this ECKey as an ASN.1 encoded private key, as understood by OpenSSL or used by the BitCoin reference
 * implementation in its wallet storage format.
 */
public byte[] toASN1() {
  try {
    ByteArrayOutputStream baos = new ByteArrayOutputStream(400);
    // ASN1_SEQUENCE(EC_PRIVATEKEY) = {
    //   ASN1_SIMPLE(EC_PRIVATEKEY, version, LONG),
    //   ASN1_SIMPLE(EC_PRIVATEKEY, privateKey, ASN1_OCTET_STRING),
    //   ASN1_EXP_OPT(EC_PRIVATEKEY, parameters, ECPKPARAMETERS, 0),
    //   ASN1_EXP_OPT(EC_PRIVATEKEY, publicKey, ASN1_BIT_STRING, 1)
    // } ASN1_SEQUENCE_END(EC_PRIVATEKEY)
    DERSequenceGenerator seq = new DERSequenceGenerator(baos);
    seq.addObject(new ASN1Integer(1)); // version
    seq.addObject(new DEROctetString(priv.toByteArray()));
    seq.addObject(new DERTaggedObject(0, SECNamedCurves.getByName("secp256k1").toASN1Primitive()));
    seq.addObject(new DERTaggedObject(1, new DERBitString(getPubKey())));
    seq.close();
    return baos.toByteArray();
  } catch (IOException e) {
    throw new RuntimeException(e);  // Cannot happen, writing to memory stream.
  }
}
origin: com.madgag/scprov-jdk15on

ecP = SECNamedCurves.getByName(name);
if (ecP == null)
    ecP = SECNamedCurves.getByOID(new ASN1ObjectIdentifier(name));
origin: com.madgag/scprov-jdk15on

  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;
  }
}
origin: com.madgag/scprov-jdk15on

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;
}

origin: com.madgag/scprov-jdk15on

/**
 * 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();
}
origin: com.madgag/sc-light-jdk15on

  static ECDomainParameters getECParameters(int namedCurve)
  {
    int index = namedCurve - 1;
    if (index < 0 || index >= curveNames.length)
    {
      return null;
    }

    String curveName = curveNames[index];

    // Lazily created the first time a particular curve is accessed
    X9ECParameters ecP = SECNamedCurves.getByName(curveName);

    if (ecP == null)
    {
      return null;
    }

    // It's a bit inefficient to do this conversion every time
    return new ECDomainParameters(ecP.getCurve(), ecP.getG(), ecP.getN(), ecP.getH(),
      ecP.getSeed());
  }
}
origin: com.madgag/scprov-jdk15on

if (ecP == null)
  ecP = SECNamedCurves.getByName(curveName);
  if (ecP == null)
      if (ecP == null)
        ecP = SECNamedCurves.getByOID(oid);
origin: com.madgag.spongycastle/core

name = SECNamedCurves.getName(oid);
origin: com.madgag.spongycastle/core

oid = SECNamedCurves.getOID(name);
origin: com.madgag.spongycastle/core

/**
 * 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());
  addEnumeration(v, GMNamedCurves.getNames());
  return v.elements();
}
origin: com.madgag.spongycastle/core

ecP = SECNamedCurves.getByName(name);
origin: com.madgag/sc-light-jdk15on

/**
 * 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);
}
origin: com.madgag.spongycastle/prov

name = SECNamedCurves.getName(oid);
if (name == null)
origin: com.madgag.spongycastle/prov

private static ASN1ObjectIdentifier lookupOidByName(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);
    }
    if (oid == null)
    {
      oid = ANSSINamedCurves.getOID(name);
    }
    if (oid == null)
    {
      oid = GMNamedCurves.getOID(name);
    }
  }
  return oid;
}
origin: com.madgag.spongycastle/prov

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);
    }
    if (params == null)
    {
      params = ANSSINamedCurves.getByName(curveName);
    }
    if (params == null)
    {
      params = GMNamedCurves.getByName(curveName);
    }
  }
  return params;
}
origin: com.madgag/sc-light-jdk15on

public static X9ECParameters getByName(
  String name)
{
  ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)objIds.get(Strings.toLowerCase(name));
  if (oid != null)
  {
    return getByOID(oid);
  }
  return null;
}
origin: blockcypher/java-client

X9ECParameters params = SECNamedCurves.getByName("secp256k1");
ECDomainParameters CURVE = new ECDomainParameters(params.getCurve(), params.getG(), params.getN(), params.getH());
BigInteger HALF_CURVE_ORDER = params.getN().shiftRight(1);
origin: com.madgag/scprov-jdk15on

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;
}
org.spongycastle.asn1.secSECNamedCurves

Most used methods

  • getByName
  • getByOID
    return the X9ECParameters object for the named curve represented by the passed in object identifier.
  • getName
    return the named curve name represented by the given object identifier.
  • getOID
    return the object identifier signified by the passed in name. Null if there is no object identifier
  • getNames
    returns an enumeration containing the name strings for curves contained in this structure.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Collectors (java.util.stream)
  • JFrame (javax.swing)
  • JTextField (javax.swing)
  • Join (org.hibernate.mapping)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now