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 as ConfidentialKey.

As per the design principle of ConfidentialKey, not exposing PrivateKey directly. Define subtypes for different use cases.

Author:
Kohsuke Kawaguchi
  • Constructor Details

    • RSAConfidentialKey

      protected RSAConfidentialKey(String id)
    • RSAConfidentialKey

      protected RSAConfidentialKey(Class owner, String shortName)
  • Method Details

    • 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 as RSADigitalSignatureConfidentialKey.

      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.