public class CredentialsUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CredentialsUtils.PrivateKeyEncoding
The encoding used to serialize proxy credentials private key.
|
Modifier and Type | Field and Description |
---|---|
static CredentialsUtils.PrivateKeyEncoding |
DEFAULT_ENCONDING
The default encoding used when no encoding is specified by callers.
|
Constructor and Description |
---|
CredentialsUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
savePrivateKey(OutputStream os,
PrivateKey key,
CredentialsUtils.PrivateKeyEncoding encoding)
Serializes a private key to an output stream according to an encoding.
|
static void |
saveProxyCredentials(OutputStream os,
eu.emi.security.authn.x509.X509Credential uc)
Saves user credentials as a plain text PEM data.
|
static void |
saveProxyCredentials(OutputStream os,
eu.emi.security.authn.x509.X509Credential uc,
CredentialsUtils.PrivateKeyEncoding encoding)
Saves user credentials as a plain text PEM data.
|
static void |
saveProxyCredentials(String proxyFileName,
eu.emi.security.authn.x509.X509Credential uc)
Saves proxy credentials to a file.
|
static void |
saveProxyCredentials(String proxyFileName,
eu.emi.security.authn.x509.X509Credential uc,
CredentialsUtils.PrivateKeyEncoding encoding)
Saves proxy credentials to a file.
|
public static final CredentialsUtils.PrivateKeyEncoding DEFAULT_ENCONDING
public static void savePrivateKey(OutputStream os, PrivateKey key, CredentialsUtils.PrivateKeyEncoding encoding) throws IllegalArgumentException, IOException
os
- output streamkey
- private keyencoding
- private key encodingIllegalArgumentException
- illegal argument exceptionIOException
- IO exceptionpublic static void saveProxyCredentials(OutputStream os, eu.emi.security.authn.x509.X509Credential uc, CredentialsUtils.PrivateKeyEncoding encoding) throws UnrecoverableKeyException, KeyStoreException, IllegalArgumentException, NoSuchAlgorithmException, IOException, NoSuchProviderException, CertificateException
os
- output streamuc
- user credentialencoding
- private key encodingUnrecoverableKeyException
- unrecoverable key exceptionKeyStoreException
- key store exceptionIllegalArgumentException
- illegal argument exceptionNoSuchAlgorithmException
- no such algorithm exceptionIOException
- IO exceptionNoSuchProviderException
- no such provider exceptionCertificateException
- certificate exceptionpublic static void saveProxyCredentials(OutputStream os, eu.emi.security.authn.x509.X509Credential uc) throws UnrecoverableKeyException, KeyStoreException, IllegalArgumentException, NoSuchAlgorithmException, IOException, NoSuchProviderException, CertificateException
DEFAULT_ENCONDING
.os
- output streamuc
- user credendialUnrecoverableKeyException
- unrecoverable key exceptionKeyStoreException
- key store exceptionIllegalArgumentException
- illegal argument exceptionNoSuchAlgorithmException
- no such algorithm exceptionIOException
- IO exceptionNoSuchProviderException
- no such provider exceptionCertificateException
- certificate exceptionpublic static void saveProxyCredentials(String proxyFileName, eu.emi.security.authn.x509.X509Credential uc, CredentialsUtils.PrivateKeyEncoding encoding) throws IOException, UnrecoverableKeyException, KeyStoreException, IllegalArgumentException, NoSuchAlgorithmException, NoSuchProviderException, CertificateException
proxyFileName
- the file where the proxy will be saveduc
- the credential to be savedencoding
- the private key encodingIOException
- IOExceptionUnrecoverableKeyException
- unrecoverable key exceptionKeyStoreException
- key store exceptionIllegalArgumentException
- illegal argument exceptionNoSuchAlgorithmException
- no such algorithm exceptionNoSuchProviderException
- no such provider exceptionCertificateException
- certificate exceptionpublic static void saveProxyCredentials(String proxyFileName, eu.emi.security.authn.x509.X509Credential uc) throws UnrecoverableKeyException, KeyStoreException, IllegalArgumentException, NoSuchAlgorithmException, NoSuchProviderException, CertificateException, IOException
DEFAULT_ENCONDING
.proxyFileName
- the file where the proxy will be saveduc
- the credential to be savedUnrecoverableKeyException
- unrecoverable key exceptionKeyStoreException
- key store exceptionIllegalArgumentException
- illegal argument exceptionNoSuchAlgorithmException
- no such algorithm exceptionNoSuchProviderException
- no such provider exceptionCertificateException
- certificate exceptionIOException
- IOExceptionCopyright © 2016. All rights reserved.