Package jenkins.security
Class RSAConfidentialKey
- java.lang.Object
-
- jenkins.security.ConfidentialKey
-
- jenkins.security.RSAConfidentialKey
-
- Direct Known Subclasses:
RSADigitalSignatureConfidentialKey
public abstract class RSAConfidentialKey extends ConfidentialKey
RSA public/private key pair asConfidentialKey
.As per the design principle of
ConfidentialKey
, not exposingPrivateKey
directly. Define subtypes for different use cases.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RSAConfidentialKey(Class owner, String shortName)
protected
RSAConfidentialKey(String id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEncodedPublicKey()
Gets base64-encoded public key.protected RSAPrivateKey
getPrivateKey()
Obtains the private key (lazily.)RSAPublicKey
getPublicKey()
-
Methods inherited from class jenkins.security.ConfidentialKey
getId, load, store
-
-
-
-
Method Detail
-
getPrivateKey
protected RSAPrivateKey getPrivateKey()
Obtains the private key (lazily.)This method is not publicly exposed as per the design principle of
ConfidentialKey
. Instead of exposing private key, define methods that use them in specific way, such asRSADigitalSignatureConfidentialKey
.- Throws:
Error
- If key cannot be loaded for some reasons, we fail.
-
getPublicKey
public RSAPublicKey getPublicKey()
-
getEncodedPublicKey
public String getEncodedPublicKey()
Gets base64-encoded public key.
-
-