Class KeyMaterialFactory
java.lang.Object
org.jenkinsci.plugins.docker.commons.credentials.KeyMaterialFactory
- Direct Known Subclasses:
- CompositeKeyMaterialFactory,- NullKeyMaterialFactory,- RegistryKeyMaterialFactory,- ServerHostKeyMaterialFactory,- ServerKeyMaterialFactory
Represents a locally extracted credentials information.
 
Whenever you want to fork off docker directly or indirectly, use this object to set up environment variables so that docker will talk to the right daemon.
- Author:
- Kohsuke Kawaguchi
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcontextualize(KeyMaterialContext context) Sets theKeyMaterialContextwithin which thisKeyMaterialFactorycanmaterialize()KeyMaterialinstances.protected final FilePathCreates a read-protected directory insideKeyMaterialContext.getBaseDir()suitable for storing secret files.protected final hudson.remoting.VirtualChannelprotected KeyMaterialContextDeprecated.Builds the key material environment variables needed to be passed when docker runs, to accessDockerServerCredentialsthat this object was created from.plus(KeyMaterialFactory... factories) Merge additionalKeyMaterialFactorys into one.
- 
Field Details- 
NULL
 
- 
- 
Constructor Details- 
KeyMaterialFactorypublic KeyMaterialFactory()
 
- 
- 
Method Details- 
checkContextualizedprotected void checkContextualized()
- 
contextualizeSets theKeyMaterialContextwithin which thisKeyMaterialFactorycanmaterialize()KeyMaterialinstances. Can only be called once.- Parameters:
- context- the- KeyMaterialContext.
- Returns:
- must return this(which is only returned to simplify use via method chaining)
 
- 
getContext
- 
getChannel@NonNull protected final hudson.remoting.VirtualChannel getChannel()
- 
materializeDeprecated.usematerialize2()- Throws:
- IOException
- InterruptedException
 
- 
materialize2Builds the key material environment variables needed to be passed when docker runs, to accessDockerServerCredentialsthat this object was created from.When you are done using the credentials, call KeyMaterial2.close(hudson.remoting.VirtualChannel)to allow sensitive information to be removed from the disk.- Throws:
- IOException
- InterruptedException
 
- 
createSecretsDirectoryCreates a read-protected directory insideKeyMaterialContext.getBaseDir()suitable for storing secret files. Be sure toFilePath.deleteRecursive()this inKeyMaterial.close().- Throws:
- IOException
- InterruptedException
 
- 
plusMerge additionalKeyMaterialFactorys into one.
 
- 
materialize2()