public class StringPrivateKeyProvider extends Object implements KeyProvider<PrivateKey>
See also DataUriKeyProvider, which can be used for a similar purpose but only when the key is provided in
the data URI format. StringPrivateKeyProvider also allows other formats, like PEM keys.
| Constructor and Description |
|---|
StringPrivateKeyProvider(KeyReader keyReader,
String key,
String keyId)
Creates an instance that provides a single key read from a String.
|
| Modifier and Type | Method and Description |
|---|---|
PrivateKey |
getKey(ValidatedKeyId keyId)
Provides a Key for a validated key identifier.
|
public StringPrivateKeyProvider(KeyReader keyReader, String key, String keyId)
keyReader - the key reader to parse the keykey - the actual private keykeyId - the key identifierpublic PrivateKey getKey(ValidatedKeyId keyId) throws CannotRetrieveKeyException
KeyProvidergetKey in interface KeyProvider<PrivateKey>keyId - the validated keyId of interest which is safe from directory traversalCannotRetrieveKeyException - if the key couldn't be retrieved or found.Copyright © 2017 Atlassian. All rights reserved.