Skip to content

Latest commit

 

History

History
167 lines (108 loc) · 4.22 KB

V1SshApi.md

File metadata and controls

167 lines (108 loc) · 4.22 KB

\V1SshApi

All URIs are relative to http://localhost/ejbca/ejbca-rest-api

Method HTTP request Description
Pubkey Get /v1/ssh/{ca_name}/pubkey Retrieves a CA's public key in SSH format.
Status8 Get /v1/ssh/status Get the status of this REST Resource

Pubkey

SshPublicKeyRestResponse Pubkey(ctx, caName).Execute()

Retrieves a CA's public key in SSH format.

Example

package main

import (
    "context"
    "fmt"
    "os"

    openapiclient "github.com/Keyfactor/ejbca-go-client-sdk/api/ejbca"
)

func main() {
    caName := "caName_example" // string | 

    authenticator, err := openapiclient.NewMTLSAuthenticatorBuilder().
        WithClientCertificatePath("<path to client certificate>").
        WithClientCertificateKeyPath("<path to client key>").
        WithCaCertificatePath("<path to ca certificate>").
        Build()
    if err != nil {
        panic(err)
    }

    configuration := openapiclient.NewConfiguration()
    configuration.Host = "<hostname>:<optional port>"
    configuration.SetAuthenticator(authenticator)

    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.V1SshApi.Pubkey(context.Background(), caName).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `V1SshApi.Pubkey``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Pubkey`: SshPublicKeyRestResponse
    fmt.Fprintf(os.Stdout, "Response from `V1SshApi.Pubkey`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
caName string

Other Parameters

Other parameters are passed through a pointer to a apiPubkeyRequest struct via the builder pattern

Name Type Description Notes

Return type

SshPublicKeyRestResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Status8

RestResourceStatusRestResponse Status8(ctx).Execute()

Get the status of this REST Resource

Example

package main

import (
    "context"
    "fmt"
    "os"

    openapiclient "github.com/Keyfactor/ejbca-go-client-sdk/api/ejbca"
)

func main() {

    authenticator, err := openapiclient.NewMTLSAuthenticatorBuilder().
        WithClientCertificatePath("<path to client certificate>").
        WithClientCertificateKeyPath("<path to client key>").
        WithCaCertificatePath("<path to ca certificate>").
        Build()
    if err != nil {
        panic(err)
    }

    configuration := openapiclient.NewConfiguration()
    configuration.Host = "<hostname>:<optional port>"
    configuration.SetAuthenticator(authenticator)

    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.V1SshApi.Status8(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `V1SshApi.Status8``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Status8`: RestResourceStatusRestResponse
    fmt.Fprintf(os.Stdout, "Response from `V1SshApi.Status8`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiStatus8Request struct via the builder pattern

Return type

RestResourceStatusRestResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]