Package com.venafi.vcert.sdk.connectors
Interface Connector
-
- All Superinterfaces:
IPMConnector,ISSHConnector
- All Known Subinterfaces:
TokenConnector
- All Known Implementing Classes:
CloudConnector,TppConnector,TppTokenConnector,VCertClient,VCertTknClient
public interface Connector extends ISSHConnector, IPMConnector
This represents the connector to TPP or Cloud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidauthenticate(Authentication credentials)This is the default implementation which provides a mechanism to authenticate the credentials provided in theAuthenticationobject.voidauthorize(Authentication credentials)Performs the authorization actions using the credentials provided.CertificateRequestgenerateRequest(ZoneConfiguration config, CertificateRequest request)GenerateRequest creates a new certificate request, based on the zone/policy configuration and the user dataAuthenticationgetCredentials()ConnectorTypegetType()StringgetVendorAndProductName()ImportResponseimportCertificate(ImportRequest request)Import an external certificate into Venafi.booleanisEmptyCredentials(Authentication credentials)Determines if the given credentials object is empty or not.voidping()Attempt to connect the Venafi API and returns an error if it cannotZoneConfigurationreadZoneConfiguration(String zone)Reads the zone configuration needed for generating and requesting a certificateStringrenewCertificate(RenewalRequest request)Attempts to renew a certificateStringrequestCertificate(CertificateRequest request, ZoneConfiguration zoneConfiguration)Submits the CSR to Venafi for processingStringrequestCertificate(CertificateRequest request, String zone)Submits the CSR to Venafi for processingPEMCollectionretrieveCertificate(CertificateRequest request)Retrieves the certificate for the specific IDvoidrevokeCertificate(RevocationRequest request)Attempts to revoke a certificatevoidsetBaseUrl(String url)Allows overriding the default URL used to communicate with VenafivoidsetVendorAndProductName(String vendorAndProductName)Set the vendor and product namevoidsetZone(String zone)Set the default zone-
Methods inherited from interface com.venafi.vcert.sdk.connectors.IPMConnector
getPolicy, readPolicyConfiguration, setPolicy
-
Methods inherited from interface com.venafi.vcert.sdk.connectors.ISSHConnector
requestSshCertificate, retrieveSshCertificate, retrieveSshConfig
-
-
-
-
Method Detail
-
getCredentials
Authentication getCredentials()
-
getType
ConnectorType getType()
- Returns:
- ConnectorType the type of connector Cloud or TPP
-
setBaseUrl
void setBaseUrl(String url) throws VCertException
Allows overriding the default URL used to communicate with Venafi- Parameters:
url-- Throws:
VCertException
-
setZone
void setZone(String zone)
Set the default zone- Parameters:
zone-
-
setVendorAndProductName
void setVendorAndProductName(String vendorAndProductName)
Set the vendor and product name- Parameters:
vendorAndProductName-
-
getVendorAndProductName
String getVendorAndProductName()
- Returns:
- the vendor and product name
-
ping
void ping() throws VCertException
Attempt to connect the Venafi API and returns an error if it cannot- Throws:
VCertException
-
authenticate
default void authenticate(Authentication credentials) throws VCertException
This is the default implementation which provides a mechanism to authenticate the credentials provided in theAuthenticationobject. Behind the scene, it's validating if the credentials were provided calling theisEmptyCredentials(Authentication)method and if that returns true, then aConnectorException.MissingCredentialsExceptionis thrown. If the credentials are not empty then is called theauthorize(Authentication)method.- Parameters:
credentials-- Throws:
VCertException
-
isEmptyCredentials
boolean isEmptyCredentials(Authentication credentials)
Determines if the given credentials object is empty or not. This method is used byauthenticate(Authentication)method to determine if the credentials were provided in order to after invoke theauthorize(Authentication)method.- Parameters:
credentials-- Returns:
-
authorize
void authorize(Authentication credentials) throws VCertException
Performs the authorization actions using the credentials provided. This method is used byauthenticate(Authentication)method after the credentials were validated as not empty.- Parameters:
credentials-- Throws:
VCertException
-
readZoneConfiguration
ZoneConfiguration readZoneConfiguration(String zone) throws VCertException
Reads the zone configuration needed for generating and requesting a certificate- Parameters:
zone- ID (e.g. 2ebd4ec1-57f7-4994-8651-e396b286a3a8) or zone path (e.g. "ProjectName\ZoneName")- Returns:
- Throws:
VCertException
-
generateRequest
CertificateRequest generateRequest(ZoneConfiguration config, CertificateRequest request) throws VCertException
GenerateRequest creates a new certificate request, based on the zone/policy configuration and the user data- Parameters:
config-- Returns:
- the zone configuration
- Throws:
VCertException
-
requestCertificate
String requestCertificate(CertificateRequest request, ZoneConfiguration zoneConfiguration) throws VCertException
Submits the CSR to Venafi for processing- Parameters:
request-zoneConfiguration-- Returns:
- request id to track the certificate status.
- Throws:
VCertException
-
requestCertificate
String requestCertificate(CertificateRequest request, String zone) throws VCertException
Submits the CSR to Venafi for processing- Parameters:
request-zone-- Returns:
- request id to track the certificate status.
- Throws:
VCertException
-
retrieveCertificate
PEMCollection retrieveCertificate(CertificateRequest request) throws VCertException
Retrieves the certificate for the specific ID- Parameters:
request-- Returns:
- A collection of PEM files including certificate, chain and potentially a private key.
- Throws:
VCertException
-
revokeCertificate
void revokeCertificate(RevocationRequest request) throws VCertException
Attempts to revoke a certificate- Parameters:
request-- Throws:
VCertException
-
renewCertificate
String renewCertificate(RenewalRequest request) throws VCertException
Attempts to renew a certificate- Parameters:
request-- Returns:
- Throws:
VCertException
-
importCertificate
ImportResponse importCertificate(ImportRequest request) throws VCertException
Import an external certificate into Venafi.- Parameters:
request-- Returns:
- Throws:
VCertException
-
-