Package pro.gravit.launchserver.helper
Class SignHelper
- java.lang.Object
-
- pro.gravit.launchserver.helper.SignHelper
-
public class SignHelper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSignHelper.HashingNonClosingOutputStreamHelper output stream that also sends the data to the given.static classSignHelper.HashingOutputStreamHelper output stream that also sends the data to the given.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringhashFunctionNamestatic java.io.OutputStreamNULL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.bouncycastle.cms.CMSSignedDataGeneratorcreateSignedDataGenerator(java.security.KeyStore keyStore, java.lang.String keyAlias, java.lang.String signAlgo, java.lang.String keyPassword)Creates the beast that can actually sign the data (for JKS, for other make it).static org.bouncycastle.cms.CMSSignedDataGeneratorcreateSignedDataGenerator(java.security.PrivateKey privateKey, java.security.cert.Certificate cert, java.util.List<java.security.cert.Certificate> certChain, java.lang.String signAlgo)static java.security.KeyStoregetStore(java.nio.file.Path file, java.lang.String storepass, java.lang.String algo)Creates the KeyStore with given algo.static java.security.MessageDigesthasher()
-
-
-
Field Detail
-
NULL
public static final java.io.OutputStream NULL
-
hashFunctionName
public static final java.lang.String hashFunctionName
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStore
public static java.security.KeyStore getStore(java.nio.file.Path file, java.lang.String storepass, java.lang.String algo) throws java.io.IOExceptionCreates the KeyStore with given algo.- Throws:
java.io.IOException
-
createSignedDataGenerator
public static org.bouncycastle.cms.CMSSignedDataGenerator createSignedDataGenerator(java.security.KeyStore keyStore, java.lang.String keyAlias, java.lang.String signAlgo, java.lang.String keyPassword) throws java.security.KeyStoreException, org.bouncycastle.operator.OperatorCreationException, java.security.cert.CertificateEncodingException, java.security.UnrecoverableKeyException, java.security.NoSuchAlgorithmException, org.bouncycastle.cms.CMSExceptionCreates the beast that can actually sign the data (for JKS, for other make it).- Throws:
java.security.KeyStoreExceptionorg.bouncycastle.operator.OperatorCreationExceptionjava.security.cert.CertificateEncodingExceptionjava.security.UnrecoverableKeyExceptionjava.security.NoSuchAlgorithmExceptionorg.bouncycastle.cms.CMSException
-
createSignedDataGenerator
public static org.bouncycastle.cms.CMSSignedDataGenerator createSignedDataGenerator(java.security.PrivateKey privateKey, java.security.cert.Certificate cert, java.util.List<java.security.cert.Certificate> certChain, java.lang.String signAlgo) throws org.bouncycastle.operator.OperatorCreationException, java.security.cert.CertificateEncodingException, org.bouncycastle.cms.CMSException- Throws:
org.bouncycastle.operator.OperatorCreationExceptionjava.security.cert.CertificateEncodingExceptionorg.bouncycastle.cms.CMSException
-
hasher
public static java.security.MessageDigest hasher()
-
-