-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for Java 9 signature algorithm names with P1363 #751
Comments
Hello. Here is a workaround I use. import org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.Provider;
import java.security.Security;
public class BcP1363Provider extends Provider {
public BcP1363Provider() {
super("BcP1363", "1.0", "Bouncy Castle - P1363 Bridge");
put("Signature.SHA256withECDSAinP1363Format", SignatureSpi.ecCVCDSA256.class.getName());
}
}
Security.insertProviderAt(new BouncyCastleProvider(), 1);
Security.insertProviderAt(new BcP1363Provider(), 1); |
The missing support is specially tricky when Java Sun/JCP XMLSignature implementation is used. Normally you don't have to specify a Provider for Signature.getInstance("algo") to work properly with keys from BouncyCastle, as the internal engineInitSign method will iterate over providers and check with each if it is compatible with. However with "default" XMLSignature implementation it will resolve a SignatureMethod object - Note that the apache xmlsec implementation - The issue is in what happens in Fix 1) is what @robelcik suggested - add a custom provider that provides these "inP1363" sig algos from BC. Fix 2) uses an implementation detail of |
Java 9 introduced new standard algorithm names to support signature algorithms with an output as defined in IEEE P1363 format, e.g.
SHA256withECDSAinP1363Format
: https://docs.oracle.com/javase/9/docs/specs/security/standard-names.html#signature-algorithmsIt would be good if BC provider could support these in
Signature.getInstance(algorithm, provider)
.The text was updated successfully, but these errors were encountered: