Package jenkins.security
Class DefaultConfidentialStore
java.lang.Object
jenkins.security.ConfidentialStore
jenkins.security.DefaultConfidentialStore
Default portable implementation of
ConfidentialStore that uses
a directory inside $JENKINS_HOME.
The master key is stored by default in $JENKINS_HOME/secrets/master.key but another location can be provided using the system property jenkins.security.DefaultConfidentialStore.file.
It is also possible to prevent the generation of the master key file using the system property jenkins.security.DefaultConfidentialStore.readOnly.
In this case, the master key file must be provided or startup will fail.
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class jenkins.security.ConfidentialStore
ConfidentialStore.Mock -
Constructor Summary
ConstructorsModifierConstructorDescriptionDefaultConfidentialStore(File rootDir) protectedDefaultConfidentialStore(File rootDir, File keyFile) -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]load(ConfidentialKey key) Reverse operation ofstore(ConfidentialKey, byte[])byte[]randomBytes(int size) Works likeSecureRandom.nextBytes(byte[]).protected voidstore(ConfidentialKey key, byte[] payload) Persists the payload ofConfidentialKeyto the disk.Methods inherited from class jenkins.security.ConfidentialStore
get
-
Constructor Details
-
DefaultConfidentialStore
- Throws:
IOExceptionInterruptedException
-
DefaultConfidentialStore
- Throws:
IOExceptionInterruptedException
-
DefaultConfidentialStore
protected DefaultConfidentialStore(File rootDir, File keyFile) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
-
Method Details
-
store
Persists the payload ofConfidentialKeyto the disk.- Specified by:
storein classConfidentialStore- Throws:
IOException
-
load
Reverse operation ofstore(ConfidentialKey, byte[])- Specified by:
loadin classConfidentialStore- Returns:
- null the data has not been previously persisted.
- Throws:
IOException
-
randomBytes
public byte[] randomBytes(int size) Description copied from class:ConfidentialStoreWorks likeSecureRandom.nextBytes(byte[]). This enables implementations to consult other entropy sources, if it's available.- Specified by:
randomBytesin classConfidentialStore
-