Search in sources :

Example 1 with ServiceContext

use of org.platformlayer.ops.helpers.ServiceContext in project platformlayer by platformlayer.

the class ServiceProviderBase method getSshPublicKey.

@Override
public PublicKey getSshPublicKey() throws OpsException {
    ServiceContext serviceContext = injector.getInstance(ServiceContext.class);
    SshKey sshKey = serviceContext.getSshKey();
    if (sshKey == null) {
        return null;
    }
    PublicKey publicKey = sshKey.getKeyPair().getPublic();
    return publicKey;
}
Also used : SshKey(org.platformlayer.ops.helpers.SshKey) ServiceContext(org.platformlayer.ops.helpers.ServiceContext) PublicKey(java.security.PublicKey)

Aggregations

PublicKey (java.security.PublicKey)1 ServiceContext (org.platformlayer.ops.helpers.ServiceContext)1 SshKey (org.platformlayer.ops.helpers.SshKey)1