Page MenuHomestyx hydra

PassphraseSSHGeneratedKeyCredentialType.php
No OneTemporary

PassphraseSSHGeneratedKeyCredentialType.php

<?php
final class PassphraseSSHGeneratedKeyCredentialType
extends PassphraseSSHPrivateKeyCredentialType {
const CREDENTIAL_TYPE = 'ssh-generated-key';
public function getCredentialType() {
return self::CREDENTIAL_TYPE;
}
public function getCredentialTypeName() {
return pht('SSH Private Key (Generated)');
}
public function getCredentialTypeDescription() {
return pht('Generate an SSH keypair.');
}
public function getSecretLabel() {
return pht('Generated Key');
}
public function didInitializeNewCredential(
PhabricatorUser $actor,
PassphraseCredential $credential) {
$pair = PhabricatorSSHKeyGenerator::generateKeypair();
list($public_key, $private_key) = $pair;
$credential->attachSecret(new PhutilOpaqueEnvelope($private_key));
return $credential;
}
}

File Metadata

Mime Type
text/x-php
Expires
Wed, Nov 26, 7:30 PM (13 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
346757
Default Alt Text
PassphraseSSHGeneratedKeyCredentialType.php (831 B)

Event Timeline