Package jenkins.security
Class DefaultConfidentialStore
- java.lang.Object
-
- jenkins.security.ConfidentialStore
-
- jenkins.security.DefaultConfidentialStore
-
public class DefaultConfidentialStore extends ConfidentialStore
Default portable implementation ofConfidentialStore
that uses a directory inside $JENKINS_HOME. The master key is also stored in this same directory.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description DefaultConfidentialStore()
DefaultConfidentialStore(File rootDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
load(ConfidentialKey key)
Reverse operation ofstore(ConfidentialKey, byte[])
byte[]
randomBytes(int size)
Works likeSecureRandom.nextBytes(byte[])
.protected void
store(ConfidentialKey key, byte[] payload)
Persists the payload ofConfidentialKey
to the disk.-
Methods inherited from class jenkins.security.ConfidentialStore
get
-
-
-
-
Constructor Detail
-
DefaultConfidentialStore
public DefaultConfidentialStore() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
DefaultConfidentialStore
public DefaultConfidentialStore(File rootDir) throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
-
Method Detail
-
store
protected void store(ConfidentialKey key, byte[] payload) throws IOException
Persists the payload ofConfidentialKey
to the disk.- Specified by:
store
in classConfidentialStore
- Throws:
IOException
-
load
protected byte[] load(ConfidentialKey key) throws IOException
Reverse operation ofstore(ConfidentialKey, byte[])
- Specified by:
load
in classConfidentialStore
- Returns:
- null the data has not been previously persisted.
- Throws:
IOException
-
randomBytes
public byte[] randomBytes(int size)
Description copied from class:ConfidentialStore
Works likeSecureRandom.nextBytes(byte[])
. This enables implementations to consult other entropy sources, if it's available.- Specified by:
randomBytes
in classConfidentialStore
-
-