public class PkiOps extends Object
| Constructor and Description |
|---|
PkiOps() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
calcSha1(byte[] content) |
byte[] |
calcSha224(byte[] content) |
byte[] |
calcSha256(byte[] content) |
byte[] |
calcSha384(byte[] content) |
byte[] |
calcSha512(byte[] content) |
PublicKey |
createPublicKey(String pubKey) |
X509Certificate |
loadCertFromP12(InputStream is,
String passwd) |
X509Certificate |
loadCertFromP12(String certFilePath,
String passwd) |
PrivateKey |
loadPrivFromP12(InputStream is,
String passwd) |
PrivateKey |
loadPrivFromP12(String certFilePath,
String passwd) |
static byte[] |
signSha1(PrivateKey pk,
byte[] data) |
static byte[] |
signSha224(PrivateKey pk,
byte[] data) |
static byte[] |
signSha256(PrivateKey pk,
byte[] data) |
static byte[] |
signSha384(PrivateKey pk,
byte[] data) |
static byte[] |
signSha512(PrivateKey pk,
byte[] data) |
boolean |
verify(org.bouncycastle.cms.CMSSignedData csd) |
boolean |
verify(String contentPath,
String envPath) |
public static byte[] signSha1(PrivateKey pk, byte[] data) throws Exception
Exceptionpublic static byte[] signSha224(PrivateKey pk, byte[] data) throws Exception
Exceptionpublic static byte[] signSha256(PrivateKey pk, byte[] data) throws Exception
Exceptionpublic static byte[] signSha384(PrivateKey pk, byte[] data) throws Exception
Exceptionpublic static byte[] signSha512(PrivateKey pk, byte[] data) throws Exception
Exceptionpublic byte[] calcSha1(byte[] content)
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic byte[] calcSha224(byte[] content)
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic byte[] calcSha256(byte[] content)
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic byte[] calcSha384(byte[] content)
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic byte[] calcSha512(byte[] content)
throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic boolean verify(org.bouncycastle.cms.CMSSignedData csd)
throws Exception
Exceptionpublic X509Certificate loadCertFromP12(String certFilePath, String passwd) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException
public X509Certificate loadCertFromP12(InputStream is, String passwd) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException
public PrivateKey loadPrivFromP12(String certFilePath, String passwd) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException
public PrivateKey loadPrivFromP12(InputStream is, String passwd) throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException, FileNotFoundException
Copyright © 2020. All rights reserved.