Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ed25519 OIDs and signature algorithm mappings #2

Open
wants to merge 1 commit into
base: eddsa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.bouncycastle.asn1.edcurves;

import org.bouncycastle.asn1.ASN1ObjectIdentifier;

/**
*
* edwards-curves-algs:
* draft-ietf-curdle-pkix
*/
public interface EdwardsCurvesObjectIdentifiers
{
static final ASN1ObjectIdentifier edwardsCurvesAlgs = new ASN1ObjectIdentifier("1.3.101");

static final ASN1ObjectIdentifier id_X25519 = edwardsCurvesAlgs.branch("110");
static final ASN1ObjectIdentifier id_X448 = edwardsCurvesAlgs.branch("111");
static final ASN1ObjectIdentifier id_Ed25519 = edwardsCurvesAlgs.branch("112");
static final ASN1ObjectIdentifier id_Ed448 = edwardsCurvesAlgs.branch("113");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.bouncycastle.asn1.bsi.BSIObjectIdentifiers;
import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
import org.bouncycastle.asn1.eac.EACObjectIdentifiers;
import org.bouncycastle.asn1.edcurves.EdwardsCurvesObjectIdentifiers;
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
import org.bouncycastle.asn1.oiw.OIWObjectIdentifiers;
import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers;
Expand Down Expand Up @@ -92,6 +93,7 @@ public class DefaultSignatureAlgorithmIdentifierFinder
algorithms.put("SHA256WITHCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_256);
algorithms.put("SHA384WITHCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_384);
algorithms.put("SHA512WITHCVC-ECDSA", EACObjectIdentifiers.id_TA_ECDSA_SHA_512);
algorithms.put("SHA512WITHED25519", EdwardsCurvesObjectIdentifiers.id_Ed25519);
//
// According to RFC 3279, the ASN.1 encoding SHALL (id-dsa-with-sha1) or MUST (ecdsa-with-SHA*) omit the parameters field.
// The parameters field SHALL be NULL for RSA based signature algorithms.
Expand All @@ -106,6 +108,7 @@ public class DefaultSignatureAlgorithmIdentifierFinder
noParams.add(NISTObjectIdentifiers.dsa_with_sha256);
noParams.add(NISTObjectIdentifiers.dsa_with_sha384);
noParams.add(NISTObjectIdentifiers.dsa_with_sha512);
noParams.add(EdwardsCurvesObjectIdentifiers.id_Ed25519);

//
// RFC 4491
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.bouncycastle.asn1.bsi.BSIObjectIdentifiers;
import org.bouncycastle.asn1.cryptopro.CryptoProObjectIdentifiers;
import org.bouncycastle.asn1.eac.EACObjectIdentifiers;
import org.bouncycastle.asn1.edcurves.EdwardsCurvesObjectIdentifiers;
import org.bouncycastle.asn1.kisa.KISAObjectIdentifiers;
import org.bouncycastle.asn1.nist.NISTObjectIdentifiers;
import org.bouncycastle.asn1.ntt.NTTObjectIdentifiers;
Expand Down Expand Up @@ -88,6 +89,7 @@ class OperatorHelper
oids.put(OIWObjectIdentifiers.dsaWithSHA1, "SHA1WITHDSA");
oids.put(NISTObjectIdentifiers.dsa_with_sha224, "SHA224WITHDSA");
oids.put(NISTObjectIdentifiers.dsa_with_sha256, "SHA256WITHDSA");
oids.put(EdwardsCurvesObjectIdentifiers.id_Ed25519, "SHA512WITHED25519");

oids.put(OIWObjectIdentifiers.idSHA1, "SHA-1");
oids.put(NISTObjectIdentifiers.id_sha224, "SHA-224");
Expand Down