Class PKIUtil
- java.lang.Object
-
- com.github.toolarium.security.util.PKIUtil
-
public final class PKIUtil extends java.lang.ObjectThis class implements some handy methods in context of PKI
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPRIVATE_DSA_KEY_ENDthe private DSA key certifcate endstatic java.lang.StringPRIVATE_DSA_KEY_STARTthe private DSA key certifcate startstatic java.lang.StringPRIVATE_RSA_KEY_ENDthe private RSA key certifcate endstatic java.lang.StringPRIVATE_RSA_KEY_STARTthe private RSA key certifcate startstatic java.lang.StringPUBLIC_CERTIFICATE_ENDthe public key certifcate endstatic java.lang.StringPUBLIC_CERTIFICATE_STARTthe public key certifcate startstatic java.lang.StringPUBLIC_DSA_KEY_ENDthe public dsa key endstatic java.lang.StringPUBLIC_DSA_KEY_STARTthe public dsa key startstatic java.lang.StringPUBLIC_RSA_KEY_ENDthe public rsa key endstatic java.lang.StringPUBLIC_RSA_KEY_STARTthe public rsa key start
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.security.cert.X509Certificate[]combineCertificates(java.security.cert.X509Certificate[] certs, java.security.cert.X509Certificate[] caCerts)Combine two certificate arraysstatic javax.security.cert.X509Certificateconvert(java.security.cert.X509Certificate cert)Converts to javax.securitystatic java.security.cert.X509Certificateconvert(javax.security.cert.X509Certificate cert)Converts to java.securityprotected com.github.toolarium.common.ByteArrayformatBuffer(com.github.toolarium.common.ByteArray rawCertificate, int rowWith, java.lang.String startTag, java.lang.String endTag)Formats a raw base64 encoded data to a well formed data.com.github.toolarium.common.ByteArrayformatDSAPKCS8(com.github.toolarium.common.ByteArray rawData)Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.java.lang.StringformatDSAPublicKey(java.security.PublicKey publicKey)Formats a public dsa key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN DSA PUBLIC KEY-----, and bounded at the end by-----END DSA PUBLIC KEY-----.com.github.toolarium.common.ByteArrayformatPKCS7(com.github.toolarium.common.ByteArray rawCertificate)Formats a raw base64 encoded X509 certificates to a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.com.github.toolarium.common.ByteArrayformatPKCS7(java.security.cert.Certificate certificate)Formats a certificate to a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.java.lang.StringformatPKCS7(java.security.cert.X509Certificate[] certificateChain)Create certificate chain into a well formed string representationjava.lang.StringformatPrivateKey(java.security.PrivateKey privateKey)Formats a private key into a well formed private key, which is bounded at the beginning and ending with the corresponding messages (see PKCS8).java.lang.StringformatPublicKey(java.security.PublicKey publicKey)Formats a public key into a well formed private key, which is bounded at the beginning and ending with the corresponding messages (see PKCS8).com.github.toolarium.common.ByteArrayformatRSAPKCS8(com.github.toolarium.common.ByteArray rawData)Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.java.lang.StringformatRSAPublicKey(java.security.PublicKey publicKey)Formats a public rsa key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN RSA PUBLIC KEY-----, and bounded at the end by-----END RSA PUBLIC KEY-----.java.security.KeyPairgenerateKeyPair(java.lang.String algorithm, int keySize)Generates a KeyPair containing a Private- and PublicKeyjava.security.KeyPairgenerateKeyPair(java.lang.String provider, java.lang.String algorithm, int k)Generates a KeyPair containing a Private- and PublicKeyjava.security.PrivateKeygetDSAPrivateKey(byte[] buffer)Reads PKCS#8 formated DSA private key from a buffer, which are each bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.java.security.PrivateKeygetDSAPrivateKey(java.lang.String fileName)Reads PKCS#8 formated DSA private key from a file, which are each bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.java.security.PublicKeygetDSAPublicKey(byte[] buffer)Reads PKCS#8 formated public key from a buffer which are each bounded at the beginning by-----BEGIN PUBLIC KEY-----, and bounded at the end by-----END PUBLIC KEY-----.static PKIUtilgetInstance()Get the instancejava.security.PrivateKeygetRSAPrivateKey(com.github.toolarium.common.ByteArray buffer)Reads PKCS#8 formated RSA private key from a buffer, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.java.security.PrivateKeygetRSAPrivateKey(java.lang.String fileName)Reads PKCS#8 formated private key from a file, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.java.security.PublicKeygetRSAPublicKey(byte[] buffer)Reads PKCS#8 formated public key from a buffer, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.java.security.cert.X509Certificate[]getX509Certificates(com.github.toolarium.common.ByteArray inputData)Reas a PKCS#7 (with base64 encoded) X509 certificates from the given buffer, which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.java.security.cert.X509Certificate[]getX509Certificates(java.lang.String fileName)Reas a PKCS#7 (with base64 encoded) X509 certificates from a file, which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.voidlogCertificate(java.lang.String msg, java.security.cert.X509Certificate... cert)Logs a given certificatevoidlogPrivateKeyInfo(java.lang.String msg, java.security.PrivateKey privateKey)Logs information of a given private keyvoidlogPublicKeyInfo(java.lang.String msg, java.security.PublicKey publicKey)Logs information of a given public keyprotected com.github.toolarium.common.ByteArraynormalizeBuffer(com.github.toolarium.common.ByteArray rawCertificate, java.lang.String startTag, java.lang.String endTag)Normalize a raw base64 encoded data to a well formed data.com.github.toolarium.common.ByteArraynormalizeDSAPKCS8(com.github.toolarium.common.ByteArray rawData)Normalize a raw base64 encoded PKCS8 to a well formed private key.com.github.toolarium.common.ByteArraynormalizeRSAPKCS8(com.github.toolarium.common.ByteArray rawData)Normalize a raw base64 encoded PKCS8 to a well formed private key.CertificateStorereadPKCS12KeyPair(java.lang.String fileName, java.lang.String provider, java.lang.String alias, java.lang.String password)Read a PKCS12 file as keystorejava.security.KeyStorereadPKCS12KeyStore(java.lang.String fileName, java.lang.String provider, java.lang.String password)Read a PKCS12 file as keystorevoidverifyCertificate(java.security.cert.X509Certificate userCertificate)Verifies the digital signature of a certificate.voidverifyCertificate(java.security.cert.X509Certificate userCert, java.security.cert.X509Certificate caCert)Verifies the digital signature of a certificate.voidverifyCertificateChain(java.security.cert.X509Certificate[] certs)Verifies a chain of certificates where the user certificate is stored at index 0.voidwritePKCS12KeyStore(java.lang.String fileName, java.lang.String provider, java.lang.String alias, java.security.PrivateKey privateKey, java.security.cert.Certificate[] certificates, java.lang.String password)Writes a PKCS12 file as keystorevoidwritePKCS12KeyStore(java.lang.String fileName, java.lang.String alias, java.security.PrivateKey privateKey, java.security.cert.Certificate[] certificates, java.lang.String password)Writes a PKCS12 file as keystore
-
-
-
Field Detail
-
PUBLIC_CERTIFICATE_START
public static final java.lang.String PUBLIC_CERTIFICATE_START
the public key certifcate start- See Also:
- Constant Field Values
-
PUBLIC_CERTIFICATE_END
public static final java.lang.String PUBLIC_CERTIFICATE_END
the public key certifcate end- See Also:
- Constant Field Values
-
PUBLIC_RSA_KEY_START
public static final java.lang.String PUBLIC_RSA_KEY_START
the public rsa key start- See Also:
- Constant Field Values
-
PUBLIC_RSA_KEY_END
public static final java.lang.String PUBLIC_RSA_KEY_END
the public rsa key end- See Also:
- Constant Field Values
-
PUBLIC_DSA_KEY_START
public static final java.lang.String PUBLIC_DSA_KEY_START
the public dsa key start- See Also:
- Constant Field Values
-
PUBLIC_DSA_KEY_END
public static final java.lang.String PUBLIC_DSA_KEY_END
the public dsa key end- See Also:
- Constant Field Values
-
PRIVATE_RSA_KEY_START
public static final java.lang.String PRIVATE_RSA_KEY_START
the private RSA key certifcate start- See Also:
- Constant Field Values
-
PRIVATE_RSA_KEY_END
public static final java.lang.String PRIVATE_RSA_KEY_END
the private RSA key certifcate end- See Also:
- Constant Field Values
-
PRIVATE_DSA_KEY_START
public static final java.lang.String PRIVATE_DSA_KEY_START
the private DSA key certifcate start- See Also:
- Constant Field Values
-
PRIVATE_DSA_KEY_END
public static final java.lang.String PRIVATE_DSA_KEY_END
the private DSA key certifcate end- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static PKIUtil getInstance()
Get the instance- Returns:
- the instance
-
generateKeyPair
public java.security.KeyPair generateKeyPair(java.lang.String algorithm, int keySize) throws java.security.GeneralSecurityExceptionGenerates a KeyPair containing a Private- and PublicKey- Parameters:
algorithm- the algorithm like: SHA1withRSA, SHA1withDSA, RSA...keySize- the size of the key- Returns:
- the created KeyPair
- Throws:
java.security.GeneralSecurityException- in case of error
-
generateKeyPair
public java.security.KeyPair generateKeyPair(java.lang.String provider, java.lang.String algorithm, int k) throws java.security.GeneralSecurityExceptionGenerates a KeyPair containing a Private- and PublicKey- Parameters:
provider- the provideralgorithm- the algorithm like: SHA1withRSA, SHA1withDSA, RSA...k- the size of the key- Returns:
- the created KeyPair
- Throws:
java.security.GeneralSecurityException- in case of error
-
getX509Certificates
public java.security.cert.X509Certificate[] getX509Certificates(java.lang.String fileName) throws java.security.GeneralSecurityException, java.io.IOExceptionReas a PKCS#7 (with base64 encoded) X509 certificates from a file, which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.- Parameters:
fileName- the file to read- Returns:
- the read certificates
- Throws:
java.security.GeneralSecurityException- in case of errorjava.io.IOException- in case of error
-
getX509Certificates
public java.security.cert.X509Certificate[] getX509Certificates(com.github.toolarium.common.ByteArray inputData) throws java.security.GeneralSecurityExceptionReas a PKCS#7 (with base64 encoded) X509 certificates from the given buffer, which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.- Parameters:
inputData- the data- Returns:
- the read certificates
- Throws:
java.security.GeneralSecurityException- in case of error
-
getDSAPublicKey
public java.security.PublicKey getDSAPublicKey(byte[] buffer) throws java.io.IOException, java.security.GeneralSecurityExceptionReads PKCS#8 formated public key from a buffer which are each bounded at the beginning by-----BEGIN PUBLIC KEY-----, and bounded at the end by-----END PUBLIC KEY-----.- Parameters:
buffer- the data- Returns:
- the public key
- Throws:
java.io.IOException- in case of errorjava.security.GeneralSecurityException- in case of error
-
getRSAPublicKey
public java.security.PublicKey getRSAPublicKey(byte[] buffer) throws java.io.IOException, java.security.GeneralSecurityExceptionReads PKCS#8 formated public key from a buffer, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.- Parameters:
buffer- the data- Returns:
- the public key
- Throws:
java.io.IOException- in case of errorjava.security.GeneralSecurityException- in case of error
-
combineCertificates
public java.security.cert.X509Certificate[] combineCertificates(java.security.cert.X509Certificate[] certs, java.security.cert.X509Certificate[] caCerts)Combine two certificate arrays- Parameters:
certs- the certificatecaCerts- the ca certificate(s)- Returns:
- the combined certificates
-
getDSAPrivateKey
public java.security.PrivateKey getDSAPrivateKey(java.lang.String fileName) throws java.io.IOException, java.security.GeneralSecurityExceptionReads PKCS#8 formated DSA private key from a file, which are each bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.- Parameters:
fileName- the file to read- Returns:
- the private key
- Throws:
java.io.IOException- in case of errorjava.security.GeneralSecurityException- in case of error
-
getDSAPrivateKey
public java.security.PrivateKey getDSAPrivateKey(byte[] buffer) throws java.security.GeneralSecurityExceptionReads PKCS#8 formated DSA private key from a buffer, which are each bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.- Parameters:
buffer- the private key to encode- Returns:
- the private key
- Throws:
java.security.GeneralSecurityException- in case of error
-
getRSAPrivateKey
public java.security.PrivateKey getRSAPrivateKey(java.lang.String fileName) throws java.io.IOException, java.security.GeneralSecurityExceptionReads PKCS#8 formated private key from a file, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.- Parameters:
fileName- the file to read- Returns:
- the private key
- Throws:
java.io.IOException- in case of errorjava.security.GeneralSecurityException- in case of error
-
getRSAPrivateKey
public java.security.PrivateKey getRSAPrivateKey(com.github.toolarium.common.ByteArray buffer) throws java.security.GeneralSecurityExceptionReads PKCS#8 formated RSA private key from a buffer, which are each bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.- Parameters:
buffer- the private key to encode- Returns:
- the private key
- Throws:
java.security.GeneralSecurityException- in case of error
-
formatPublicKey
public java.lang.String formatPublicKey(java.security.PublicKey publicKey)
Formats a public key into a well formed private key, which is bounded at the beginning and ending with the corresponding messages (see PKCS8).- Parameters:
publicKey- the public key- Returns:
- the well formed certificate
-
formatDSAPublicKey
public java.lang.String formatDSAPublicKey(java.security.PublicKey publicKey)
Formats a public dsa key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN DSA PUBLIC KEY-----, and bounded at the end by-----END DSA PUBLIC KEY-----.- Parameters:
publicKey- the public key to format- Returns:
- the well formed certificate
-
formatRSAPublicKey
public java.lang.String formatRSAPublicKey(java.security.PublicKey publicKey)
Formats a public rsa key into a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN RSA PUBLIC KEY-----, and bounded at the end by-----END RSA PUBLIC KEY-----.- Parameters:
publicKey- the public key to format- Returns:
- the well formed certificate
-
formatPKCS7
public com.github.toolarium.common.ByteArray formatPKCS7(com.github.toolarium.common.ByteArray rawCertificate)
Formats a raw base64 encoded X509 certificates to a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.- Parameters:
rawCertificate- the raw certificate to format- Returns:
- the well formed certificate
-
formatPKCS7
public java.lang.String formatPKCS7(java.security.cert.X509Certificate[] certificateChain) throws java.security.cert.CertificateEncodingExceptionCreate certificate chain into a well formed string representation- Parameters:
certificateChain- the certificate chain- Returns:
- the string representation
- Throws:
java.security.cert.CertificateEncodingException- In case of a certificate error
-
formatPKCS7
public com.github.toolarium.common.ByteArray formatPKCS7(java.security.cert.Certificate certificate) throws java.security.cert.CertificateEncodingExceptionFormats a certificate to a well formated X509 certificate (PEM format), which are each bounded at the beginning by-----BEGIN CERTIFICATE-----, and bounded at the end by-----END CERTIFICATE-----.- Parameters:
certificate- the certificate to format in PEM format- Returns:
- the well formed certificate
- Throws:
java.security.cert.CertificateEncodingException- In case of a certificate error
-
formatPrivateKey
public java.lang.String formatPrivateKey(java.security.PrivateKey privateKey)
Formats a private key into a well formed private key, which is bounded at the beginning and ending with the corresponding messages (see PKCS8).- Parameters:
privateKey- the private key- Returns:
- the well formed certificate
-
formatDSAPKCS8
public com.github.toolarium.common.ByteArray formatDSAPKCS8(com.github.toolarium.common.ByteArray rawData)
Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN DSA PRIVATE KEY-----, and bounded at the end by-----END DSA PRIVATE KEY-----.- Parameters:
rawData- the raw data to format- Returns:
- the well formed certificate
-
formatRSAPKCS8
public com.github.toolarium.common.ByteArray formatRSAPKCS8(com.github.toolarium.common.ByteArray rawData)
Formats a raw base64 encoded PKCS8 to a well formed private key, which is bounded at the beginning by-----BEGIN RSA PRIVATE KEY-----, and bounded at the end by-----END RSA PRIVATE KEY-----.- Parameters:
rawData- the raw data to format- Returns:
- the well formed certificate
-
normalizeDSAPKCS8
public com.github.toolarium.common.ByteArray normalizeDSAPKCS8(com.github.toolarium.common.ByteArray rawData)
Normalize a raw base64 encoded PKCS8 to a well formed private key.- Parameters:
rawData- the raw data to normalize- Returns:
- the normalized private key
-
normalizeRSAPKCS8
public com.github.toolarium.common.ByteArray normalizeRSAPKCS8(com.github.toolarium.common.ByteArray rawData)
Normalize a raw base64 encoded PKCS8 to a well formed private key.- Parameters:
rawData- the raw data to normalize- Returns:
- the normalized private key
-
logCertificate
public void logCertificate(java.lang.String msg, java.security.cert.X509Certificate... cert)Logs a given certificate- Parameters:
msg- the message to addcert- the cerificate to log
-
logPrivateKeyInfo
public void logPrivateKeyInfo(java.lang.String msg, java.security.PrivateKey privateKey)Logs information of a given private key- Parameters:
msg- the message to addprivateKey- the public key
-
logPublicKeyInfo
public void logPublicKeyInfo(java.lang.String msg, java.security.PublicKey publicKey)Logs information of a given public key- Parameters:
msg- the message to addpublicKey- the public key
-
verifyCertificateChain
public void verifyCertificateChain(java.security.cert.X509Certificate[] certs) throws java.security.GeneralSecurityExceptionVerifies a chain of certificates where the user certificate is stored at index 0. The self-signed top level certificate is verified using its inherent public key. Any other certificate of the chain is verified by means of the public key derived from the issuing certificate which is located one index higher in the chain. certs[0] = user certificate. certs[x] = self signed CA certificate- Parameters:
certs- the certificate chain to verify- Throws:
java.security.GeneralSecurityException- in case of error
-
verifyCertificate
public void verifyCertificate(java.security.cert.X509Certificate userCert, java.security.cert.X509Certificate caCert) throws java.security.GeneralSecurityExceptionVerifies the digital signature of a certificate.- Parameters:
userCert- the certificate to verifycaCert- the certificate of the CA which has issued the userCert ornullif the userCert is a self signed certificate- Throws:
java.security.GeneralSecurityException- in case of error
-
verifyCertificate
public void verifyCertificate(java.security.cert.X509Certificate userCertificate) throws java.security.GeneralSecurityExceptionVerifies the digital signature of a certificate.- Parameters:
userCertificate- the certificate to verify- Throws:
java.security.GeneralSecurityException- in case of error
-
readPKCS12KeyStore
public java.security.KeyStore readPKCS12KeyStore(java.lang.String fileName, java.lang.String provider, java.lang.String password) throws java.security.GeneralSecurityException, java.io.IOExceptionRead a PKCS12 file as keystore- Parameters:
fileName- the file to readprovider- the providerpassword- the password- Returns:
- the key pairs
- Throws:
java.io.IOException- in case of a file read errorjava.security.GeneralSecurityException- in case of error
-
readPKCS12KeyPair
public CertificateStore readPKCS12KeyPair(java.lang.String fileName, java.lang.String provider, java.lang.String alias, java.lang.String password) throws java.security.GeneralSecurityException, java.io.IOException
Read a PKCS12 file as keystore- Parameters:
fileName- the file to readprovider- the provideralias- the alias in the PKCS12 filepassword- the password- Returns:
- the certficiate store
- Throws:
java.security.GeneralSecurityException- in case of errorjava.io.IOException- in case of error
-
writePKCS12KeyStore
public void writePKCS12KeyStore(java.lang.String fileName, java.lang.String alias, java.security.PrivateKey privateKey, java.security.cert.Certificate[] certificates, java.lang.String password) throws java.security.GeneralSecurityException, java.io.IOExceptionWrites a PKCS12 file as keystore- Parameters:
fileName- the file to readalias- the alias in the PKCS12 fileprivateKey- the private keycertificates- the certificate chainpassword- the password- Throws:
java.security.GeneralSecurityException- in case of errorjava.io.IOException- in case of error
-
writePKCS12KeyStore
public void writePKCS12KeyStore(java.lang.String fileName, java.lang.String provider, java.lang.String alias, java.security.PrivateKey privateKey, java.security.cert.Certificate[] certificates, java.lang.String password) throws java.security.GeneralSecurityException, java.io.IOExceptionWrites a PKCS12 file as keystore- Parameters:
fileName- the file to readprovider- the provideralias- the alias in the PKCS12 fileprivateKey- the private keycertificates- the certificate chainpassword- the password- Throws:
java.security.GeneralSecurityException- in case of errorjava.io.IOException- in case of error
-
convert
public static java.security.cert.X509Certificate convert(javax.security.cert.X509Certificate cert)
Converts to java.security- Parameters:
cert- the certificate- Returns:
- the converted certificate
-
convert
public static javax.security.cert.X509Certificate convert(java.security.cert.X509Certificate cert)
Converts to javax.security- Parameters:
cert- the certificate- Returns:
- the converted certificate
-
formatBuffer
protected com.github.toolarium.common.ByteArray formatBuffer(com.github.toolarium.common.ByteArray rawCertificate, int rowWith, java.lang.String startTag, java.lang.String endTag)Formats a raw base64 encoded data to a well formed data.- Parameters:
rawCertificate- the raw certificate to formatrowWith- the with of the formatstartTag- the start tagendTag- the end tag- Returns:
- the well formed certificate
-
normalizeBuffer
protected com.github.toolarium.common.ByteArray normalizeBuffer(com.github.toolarium.common.ByteArray rawCertificate, java.lang.String startTag, java.lang.String endTag)Normalize a raw base64 encoded data to a well formed data.- Parameters:
rawCertificate- the raw certificate to formatstartTag- the start tagendTag- the end tag- Returns:
- the normalized data
-
-