/** * {@inheritDoc} */ @Override public SSHUserPrivateKey snapshot(SSHUserPrivateKey credentials) { if (credentials instanceof BasicSSHUserPrivateKey) { final PrivateKeySource keySource = ((BasicSSHUserPrivateKey) credentials).getPrivateKeySource(); if (keySource.isSnapshotSource()) { return credentials; } } final Secret passphrase = credentials.getPassphrase(); return new BasicSSHUserPrivateKey(credentials.getScope(), credentials.getId(), credentials.getUsername(), new DirectEntryPrivateKeySource(credentials.getPrivateKeys()), passphrase == null ? null : passphrase.getEncryptedValue(), credentials.getDescription()); } }
if (credentials instanceof SSHUserPrivateKey) { SSHUserPrivateKey sshUser = (SSHUserPrivateKey) credentials; listener.getLogger().println("using GIT_SSH to set credentials " + sshUser.getDescription());