Class KeyUtils
- java.lang.Object
-
- com.google.jenkins.plugins.credentials.oauth.KeyUtils
-
@Deprecated public class KeyUtils extends Object
Deprecated.Consider to useSecretBytes
instead.Utility methods for handling key files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static File
createKeyFile(String prefix, String suffix)
Deprecated.Creates a file with the given prefix/suffix in a standard Google auth directory, and sets the permissions of the file to owner-only read/write.static void
updatePermissions(File file)
Deprecated.Sets the permissions of the file to owner-only read/write.static void
writeKeyToFile(InputStream keyStream, File file)
Deprecated.Writes the key contained in the givenInputStream
to the given keyfile.static void
writeKeyToFileEncoded(String key, File file)
Deprecated.Writes the given key to the given keyfile, passing it throughSecret
to encode the string.
-
-
-
Method Detail
-
createKeyFile
public static File createKeyFile(String prefix, String suffix) throws IOException
Deprecated.Creates a file with the given prefix/suffix in a standard Google auth directory, and sets the permissions of the file to owner-only read/write. Note: this doesn't work on Windows.- Throws:
IOException
- if filesystem interaction fails.
-
updatePermissions
public static void updatePermissions(File file) throws IOException
Deprecated.Sets the permissions of the file to owner-only read/write. Note: this doesn't work on Windows.- Throws:
IOException
- if filesystem interaction fails.
-
writeKeyToFileEncoded
public static void writeKeyToFileEncoded(String key, File file) throws IOException
Deprecated.Writes the given key to the given keyfile, passing it throughSecret
to encode the string. Note that, per the documentation ofSecret
, this does not protect against an attacker who has full access to the local file system, but reduces the chance of accidental exposure.- Throws:
IOException
-
writeKeyToFile
public static void writeKeyToFile(InputStream keyStream, File file) throws IOException
Deprecated.Writes the key contained in the givenInputStream
to the given keyfile. Does not close the input stream.- Throws:
IOException
-
-