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 IOException
os
- the target output streamkey
- the key to be serializedencoding
- the encodingIllegalArgumentException
- for unsupported private key encodingsIOException
- if write fails for any reason on the output streampublic static void saveProxyCredentials(OutputStream os, eu.emi.security.authn.x509.X509Credential uc, CredentialsUtils.PrivateKeyEncoding encoding) throws IOException
os
- the output streamuc
- the user credential that must be serializedencoding
- the private key encodingIOException
- in case of errors writing on the output streampublic static void saveProxyCredentials(OutputStream os, eu.emi.security.authn.x509.X509Credential uc) throws IOException
DEFAULT_ENCONDING
.os
- the output stream for the saved proxyuc
- the user credentialIOException
- in case of errors writing to the output streampublic static void saveProxyCredentials(String proxyFileName, eu.emi.security.authn.x509.X509Credential uc, CredentialsUtils.PrivateKeyEncoding encoding) throws IOException
proxyFileName
- the file where the proxy will be saveduc
- the credential to be savedencoding
- the private key encodingIOException
- in case of errors writing to the proxy filepublic static void saveProxyCredentials(String proxyFileName, eu.emi.security.authn.x509.X509Credential uc) throws IOException
DEFAULT_ENCONDING
.proxyFileName
- the file where the proxy will be saveduc
- the credential to be savedIOException
- in case of errors writing the credential to the proxy fileCopyright © 2016. All rights reserved.