Class InstanceIdentityProvider<PUB extends PublicKey,PRIV extends PrivateKey>

java.lang.Object
jenkins.model.identity.InstanceIdentityProvider<PUB,PRIV>
Type Parameters:
PUB - the type of public key.
PRIV - the type of private key.
All Implemented Interfaces:
ExtensionPoint

public abstract class InstanceIdentityProvider<PUB extends PublicKey,PRIV extends PrivateKey> extends Object implements ExtensionPoint
A source of instance identity.

Should not be used from plugins, except to be implemented by instance-identity. Other plugins wishing to get the RSA key may depend on instance-identity directly.

Since:
2.16
  • Field Details

  • Constructor Details

    • InstanceIdentityProvider

      public InstanceIdentityProvider()
  • Method Details

    • getKeyPair

      @CheckForNull protected abstract KeyPair getKeyPair()
      Gets the KeyPair that comprises the instance identity.
      Returns:
      the KeyPair that comprises the instance identity. null could technically be returned in the event that a keypair could not be generated, for example if the specific key type of this provider is not permitted at the required length by the JCA policy. More commonly it just means that the instance-identity plugin needs to be installed.
    • getPublicKey

      @CheckForNull protected PUB getPublicKey()
      Shortcut to KeyPair.getPublic().
      Returns:
      the public key. null if getKeyPair() is null.
    • getPrivateKey

      @CheckForNull protected PRIV getPrivateKey()
      Returns:
      the private key. null if getKeyPair() is null.
    • getCertificate

      @CheckForNull protected abstract X509Certificate getCertificate()
      Gets the self-signed X509Certificate that is associated with this identity. The certificate will must be currently valid. Repeated calls to this method may result in new certificates being generated.
      Returns:
      the certificate. null if getKeyPair() is null.