Search in sources :

Example 1 with SshConfig

use of com.venafi.vcert.sdk.certificate.SshConfig in project vcert-java by Venafi.

the class AbstractTppConnector method retrieveTppSshConfig.

protected SshConfig retrieveTppSshConfig(SshCaTemplateRequest sshCaTemplateRequest) throws VCertException {
    SshConfig sshConfig = new SshConfig();
    Map<String, String> params = new HashMap<String, String>();
    if (StringUtils.isNotBlank(sshCaTemplateRequest.template()))
        params.put("DN", TppConnectorUtils.getSshCADN(sshCaTemplateRequest.template()));
    else if (StringUtils.isNotBlank(sshCaTemplateRequest.guid()))
        params.put("Guid", sshCaTemplateRequest.guid());
    else
        throw new CAOrGUIDNotProvidedException();
    // TODO confirm if it's required to catch the FeignException and rethrow it as a VcertException
    // TODO determine if itsn't required to verify that the caPublicKey is not empty
    sshConfig.caPublicKey(tppAPI.retrieveSshCAPublicKeyData(params));
    sshConfig.principals(retrieveTppSshPrincipals(sshCaTemplateRequest));
    return sshConfig;
}
Also used : SshConfig(com.venafi.vcert.sdk.certificate.SshConfig)

Example 2 with SshConfig

use of com.venafi.vcert.sdk.certificate.SshConfig in project vcert-java by Venafi.

the class TppConnectorATForSSH method retrieveSshConfig.

private void retrieveSshConfig(SshCaTemplateRequest req) throws VCertException, Exception {
    // getting the sshConfig of the SSH Cert CA
    SshConfig sshConfig = classUnderTest.retrieveSshConfig(req);
    assertNotNull(sshConfig);
    assertNotNull(sshConfig.caPublicKey());
    assertTrue(!sshConfig.caPublicKey().isEmpty());
    assertNotNull(sshConfig.principals());
    assertTrue(sshConfig.principals().length > 0);
}
Also used : SshConfig(com.venafi.vcert.sdk.certificate.SshConfig)

Example 3 with SshConfig

use of com.venafi.vcert.sdk.certificate.SshConfig in project vcert-java by Venafi.

the class TppConnectorATForSSH method retrieveSshConfigWithoutCredentials.

private void retrieveSshConfigWithoutCredentials(SshCaTemplateRequest req) throws VCertException, Exception {
    // getting the sshConfig of the SSH Cert CA
    SshConfig sshConfig = classUnderTest.retrieveSshConfig(req);
    assertNotNull(sshConfig);
    assertNotNull(sshConfig.caPublicKey());
    assertTrue(!sshConfig.caPublicKey().isEmpty());
    // When the authentication is not provided, then the principals are not retrieved
    assertNull(sshConfig.principals());
}
Also used : SshConfig(com.venafi.vcert.sdk.certificate.SshConfig)

Example 4 with SshConfig

use of com.venafi.vcert.sdk.certificate.SshConfig in project vcert-java by Venafi.

the class TppTokenConnectorATForSSH method retrieveSshConfigWithoutCredentials.

private void retrieveSshConfigWithoutCredentials(SshCaTemplateRequest req) throws VCertException, Exception {
    // getting the sshConfig of the SSH Cert CA
    SshConfig sshConfig = classUnderTest.retrieveSshConfig(req);
    assertNotNull(sshConfig);
    assertNotNull(sshConfig.caPublicKey());
    assertTrue(!sshConfig.caPublicKey().isEmpty());
    // When the authentication is not provided, then the principals are not retrieved
    assertNull(sshConfig.principals());
}
Also used : SshConfig(com.venafi.vcert.sdk.certificate.SshConfig)

Example 5 with SshConfig

use of com.venafi.vcert.sdk.certificate.SshConfig in project vcert-java by Venafi.

the class TppTokenConnectorATForSSH method retrieveSshConfig.

private void retrieveSshConfig(SshCaTemplateRequest req) throws VCertException, Exception {
    // getting the sshConfig of the SSH Cert CA
    SshConfig sshConfig = classUnderTest.retrieveSshConfig(req);
    assertNotNull(sshConfig);
    assertNotNull(sshConfig.caPublicKey());
    assertTrue(!sshConfig.caPublicKey().isEmpty());
    assertNotNull(sshConfig.principals());
    assertTrue(sshConfig.principals().length > 0);
}
Also used : SshConfig(com.venafi.vcert.sdk.certificate.SshConfig)

Aggregations

SshConfig (com.venafi.vcert.sdk.certificate.SshConfig)6 Config (com.venafi.vcert.sdk.Config)1 VCertTknClient (com.venafi.vcert.sdk.VCertTknClient)1 SshCaTemplateRequest (com.venafi.vcert.sdk.certificate.SshCaTemplateRequest)1 Authentication (com.venafi.vcert.sdk.endpoint.Authentication)1