Package jenkins.model.identity
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 oninstance-identity
directly.- Since:
- 2.16
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InstanceIdentityProvider.KeyTypes<PUB extends PublicKey,PRIV extends PrivateKey>
Holds information about the paired keytypes that can be used to form the various identity keys.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static InstanceIdentityProvider.KeyTypes<DSAPublicKey,DSAPrivateKey>
DSA
Deprecated.unusedstatic InstanceIdentityProvider.KeyTypes<ECPublicKey,ECPrivateKey>
EC
Deprecated.unusedstatic InstanceIdentityProvider.KeyTypes<RSAPublicKey,RSAPrivateKey>
RSA
RSA keys.
-
Constructor Summary
Constructors Constructor Description InstanceIdentityProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract X509Certificate
getCertificate()
Gets the self-signedX509Certificate
that is associated with this identity.protected abstract KeyPair
getKeyPair()
Gets theKeyPair
that comprises the instance identity.protected PRIV
getPrivateKey()
Shortcut toKeyPair.getPrivate()
.protected PUB
getPublicKey()
Shortcut toKeyPair.getPublic()
.
-
-
-
Field Detail
-
RSA
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final InstanceIdentityProvider.KeyTypes<RSAPublicKey,RSAPrivateKey> RSA
RSA keys.
-
DSA
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Deprecated public static final InstanceIdentityProvider.KeyTypes<DSAPublicKey,DSAPrivateKey> DSA
Deprecated.unusedDSA keys.
-
EC
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Deprecated public static final InstanceIdentityProvider.KeyTypes<ECPublicKey,ECPrivateKey> EC
Deprecated.unusedEC keys
-
-
Method Detail
-
getKeyPair
@CheckForNull protected abstract KeyPair getKeyPair()
Gets theKeyPair
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 theinstance-identity
plugin needs to be installed.
-
getPublicKey
@CheckForNull protected PUB getPublicKey()
Shortcut toKeyPair.getPublic()
.- Returns:
- the public key.
null
ifgetKeyPair()
isnull
.
-
getPrivateKey
@CheckForNull protected PRIV getPrivateKey()
Shortcut toKeyPair.getPrivate()
.- Returns:
- the private key.
null
ifgetKeyPair()
isnull
.
-
getCertificate
@CheckForNull protected abstract X509Certificate getCertificate()
Gets the self-signedX509Certificate
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
ifgetKeyPair()
isnull
.
-
-