Package com.openshift.client

Examples of com.openshift.client.SSHPublicKey


  public void shouldLoadPublicKeyRsa() throws Exception {
    // pre-conditions
    String publicKeyPath = createRandomTempFile().getAbsolutePath();
    String privateKeyPath = createRandomTempFile().getAbsolutePath();
    SSHKeyPair.create(SSHKeyTestUtils.DEFAULT_PASSPHRASE, privateKeyPath, publicKeyPath);
    ISSHPublicKey sshKey = new SSHPublicKey(new File(publicKeyPath));
    String publicKey = sshKey.getPublicKey();
    assertNotNull(sshKey.getKeyType());
    String keyType = sshKey.getKeyType().getTypeId();
    assertNotNull(publicKey);
    assertThat(publicKey)
        // no identifier
        .doesNotContain(SSHKeyTestUtils.SSH_RSA)
        // no comment
View Full Code Here


  public void shouldLoadPublicKeyDsa() throws Exception {
    // pre-conditions
    String publicKeyPath = createRandomTempFile().getAbsolutePath();
    String privateKeyPath = createRandomTempFile().getAbsolutePath();
    SSHKeyTestUtils.createDsaKeyPair(publicKeyPath, privateKeyPath);
    ISSHPublicKey sshKey = new SSHPublicKey(publicKeyPath);
    String publicKey = sshKey.getPublicKey();
    assertNotNull(sshKey.getKeyType());
    String keyType = sshKey.getKeyType().getTypeId();
    assertNotNull(publicKey);
    assertThat(publicKey)
        // no identifier
        .doesNotContain(SSHKeyTestUtils.SSH_DSA)
        // no comment
View Full Code Here

        .mockGetKeys(Samples.GET_USER_KEYS_NONE)
        .mockCreateKey(Samples.PUT_BBCC_DSA_USER_KEYS_SOMEKEY);
    String publicKeyPath = createRandomTempFile().getAbsolutePath();
    String privateKeyPath = createRandomTempFile().getAbsolutePath();
    SSHKeyTestUtils.createDsaKeyPair(publicKeyPath, privateKeyPath);
    SSHPublicKey publicKey = new SSHPublicKey(publicKeyPath);
    assertThat(user.getSSHKeys()).isEmpty();
   
    String keyName = "somekey";
    // operation
    user.addSSHKey(keyName, publicKey);
View Full Code Here

    // pre-conditions
    mockDirector.mockGetKeys(Samples.GET_USER_KEYS_1KEY);
    String publicKeyPath = createRandomTempFile().getAbsolutePath();
    String privateKeyPath = createRandomTempFile().getAbsolutePath();
    SSHKeyTestUtils.createDsaKeyPair(publicKeyPath, privateKeyPath);
    SSHPublicKey publicKey = new SSHPublicKey(publicKeyPath);

    // operation
    assertThat(user.getSSHKeys()).hasSize(1);
    String existingKeyName = user.getSSHKeys().get(0).getName();
    user.addSSHKey(existingKeyName, publicKey);
View Full Code Here

        .mockGetKeys(Samples.GET_USER_KEYS_1KEY)
        .mockCreateKey(Samples.PUT_BBCC_DSA_USER_KEYS_SOMEKEY);
    String publicKeyPath = createRandomTempFile().getAbsolutePath();
    String privateKeyPath = createRandomTempFile().getAbsolutePath();
    SSHKeyTestUtils.createDsaKeyPair(publicKeyPath, privateKeyPath);
    SSHPublicKey publicKey = new SSHPublicKey(publicKeyPath);

    // operation
    assertThat(user.getSSHKeys()).onProperty("name").contains(keyName);
    user.addSSHKey(keyName, publicKey); // throws
  }
View Full Code Here

TOP

Related Classes of com.openshift.client.SSHPublicKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.