Package com.venafi.vcert.sdk.connectors
Interface TokenConnector
-
- All Known Implementing Classes:
TppTokenConnector,VCertTknClient
public interface TokenConnectorThis represents the connector to TPP to be used with an access token.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CertificateRequestgenerateRequest(ZoneConfiguration config, CertificateRequest request)VedAuth method.TokenInfogetAccessToken()returns a new access token.TokenInfogetAccessToken(Authentication auth)returns a new access token.PolicySpecificationgetPolicy(String policyName)Returns the policySpecification from the policy which matches with the policyName argument.ConnectorTypegetType()StringgetVendorAndProductName()ImportResponseimportCertificate(ImportRequest request)VedAuth method.voidping()VedAuth method.PolicyreadPolicyConfiguration(String zone)VedAuth method.ZoneConfigurationreadZoneConfiguration(String zone)VedAuth method.TokenInforefreshAccessToken(String applicationId)this is for refreshing a token.StringrenewCertificate(RenewalRequest request)VedAuth method.StringrequestCertificate(CertificateRequest request, ZoneConfiguration zoneConfiguration)VedAuth method.StringrequestCertificate(CertificateRequest request, String zone)VedAuth method.StringrequestSshCertificate(SshCertificateRequest sshCertificateRequest)Request a new SSH Certificate.PEMCollectionretrieveCertificate(CertificateRequest request)VedAuth method.SshCertRetrieveDetailsretrieveSshCertificate(SshCertificateRequest sshCertificateRequest)Retrieve a requested SSH CertificateSshConfigretrieveSshConfig(SshCaTemplateRequest sshCaTemplateRequest)Retrieve theSshConfigof the CA specified in theSshCaTemplateRequest.intrevokeAccessToken()voidrevokeCertificate(RevocationRequest request)VedAuth method.voidsetBaseUrl(String url)Allows overriding the default URL used to communicate with VenafivoidsetPolicy(String policyName, PolicySpecification policySpecification)Create/update a policy based on the policySpecification passed as argument.voidsetVendorAndProductName(String vendorAndProductName)Set the vendor and product namevoidsetZone(String zone)Set the default zone
-
-
-
Method Detail
-
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
-
getAccessToken
TokenInfo getAccessToken(Authentication auth) throws VCertException
returns a new access token.- Parameters:
auth- authentication info- Returns:
- the new token.
- Throws:
VCertException- throws this exception when authentication info is null.
-
getAccessToken
TokenInfo getAccessToken() throws VCertException
returns a new access token. This method uses theAuthenticationobject passed earlier with theConfigobject.- Returns:
- the new token.
- Throws:
VCertException- throws this exception when authentication info is null.
-
refreshAccessToken
TokenInfo refreshAccessToken(String applicationId) throws VCertException
this is for refreshing a token.- Parameters:
applicationId- the application id.- Returns:
- a complete info about the new access token, refresh token, expires.
- Throws:
VCertException
-
revokeAccessToken
int revokeAccessToken() throws VCertException- Returns:
- 1 if the access token was revoked and 0 if not.
- Throws:
VCertException
-
ping
void ping() throws VCertException
VedAuth method. Attempt to connect the Venafi API and returns an error if it cannot- Throws:
VCertException
-
readZoneConfiguration
ZoneConfiguration readZoneConfiguration(String zone) throws VCertException
VedAuth method. 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
VedAuth method. 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, UnsupportedOperationException
VedAuth method. Submits the CSR to Venafi for processing- Parameters:
request-zoneConfiguration-- Returns:
- request id to track the certificate status.
- Throws:
VCertExceptionUnsupportedOperationException
-
requestCertificate
String requestCertificate(CertificateRequest request, String zone) throws VCertException, UnsupportedOperationException
VedAuth method. Submits the CSR to Venafi for processing- Parameters:
request-zone-- Returns:
- request id to track the certificate status.
- Throws:
VCertExceptionUnsupportedOperationException
-
retrieveCertificate
PEMCollection retrieveCertificate(CertificateRequest request) throws VCertException
VedAuth method. 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
VedAuth method. Attempts to revoke a certificate- Parameters:
request-- Throws:
VCertException
-
renewCertificate
String renewCertificate(RenewalRequest request) throws VCertException
VedAuth method. Attempts to renew a certificate- Parameters:
request-- Returns:
- Throws:
VCertException
-
importCertificate
ImportResponse importCertificate(ImportRequest request) throws VCertException
VedAuth method. Import an external certificate into Venafi.- Parameters:
request-- Returns:
- Throws:
VCertException
-
readPolicyConfiguration
Policy readPolicyConfiguration(String zone) throws VCertException
VedAuth method. Reads the policy configuration for a specific zone in Venafi- Parameters:
zone-- Returns:
- Throws:
VCertException
-
setPolicy
void setPolicy(String policyName, PolicySpecification policySpecification) throws VCertException
Create/update a policy based on the policySpecification passed as argument.- Parameters:
policyName-policySpecification-- Throws:
VCertException
-
getPolicy
PolicySpecification getPolicy(String policyName) throws VCertException
Returns the policySpecification from the policy which matches with the policyName argument.- Parameters:
policyName-- Returns:
- Throws:
VCertException
-
requestSshCertificate
String requestSshCertificate(SshCertificateRequest sshCertificateRequest) throws VCertException
Request a new SSH Certificate.- Parameters:
sshCertificateRequest- TheSshCertificateRequestinstance needed to do the request. For more information about of which properties should be filled, please review the documentation ofSshCertificateRequest.- Returns:
- The DN of the created SSH certificate object. It can be used as pickup ID to retrieve the created SSH Certificate.
For more details review the
retrieveSshCertificate(SshCertificateRequest)method. - Throws:
VCertException
-
retrieveSshCertificate
SshCertRetrieveDetails retrieveSshCertificate(SshCertificateRequest sshCertificateRequest) throws VCertException
Retrieve a requested SSH Certificate- Parameters:
sshCertificateRequest- TheSshCertificateRequestinstance needed to do the request.
It's mandatory to set the PickUpID which is the value of the DN returned when the SSH Certificate was requested. For more information about of which properties should be filled, please review the documentation ofSshCertificateRequest.- Returns:
- A
SshCertRetrieveDetailscontaining the Certificate Data of the created Certificate. - Throws:
VCertException
-
retrieveSshConfig
SshConfig retrieveSshConfig(SshCaTemplateRequest sshCaTemplateRequest) throws VCertException
Retrieve theSshConfigof the CA specified in theSshCaTemplateRequest.- Parameters:
sshCaTemplateRequest-- Returns:
- A
SshConfig. - Throws:
VCertException
-
-