cn.hyperchain.sdk.crypto.jce.ECSignatureFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of litesdk Show documentation
Show all versions of litesdk Show documentation
A Java client tool for Hyperchain
package cn.hyperchain.sdk.crypto.jce;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.Provider;
import java.security.Signature;
public final class ECSignatureFactory {
public static final String RAW_ALGORITHM = "NONEwithECDSA";
private static final String rawAlgorithmAssertionMsg =
"Assumed the JRE supports NONEwithECDSA signatures";
private ECSignatureFactory() {
}
public static Signature getRawInstance() {
try {
return Signature.getInstance(RAW_ALGORITHM);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(rawAlgorithmAssertionMsg);
}
}
public static Signature getRawInstance(final String provider) throws NoSuchProviderException {
try {
return Signature.getInstance(RAW_ALGORITHM, provider);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(rawAlgorithmAssertionMsg);
}
}
public static Signature getRawInstance(final Provider provider) {
try {
return Signature.getInstance(RAW_ALGORITHM, provider);
} catch (NoSuchAlgorithmException ex) {
throw new AssertionError(rawAlgorithmAssertionMsg);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy