MCPcopy Index your code
hub / github.com/ory/hydra / NewEncryptionKey

Function NewEncryptionKey

cmd/cli/handler_helper.go:22–50  ·  view source on GitHub ↗

NewEncryptionKey for client secret

(cmd *cobra.Command, client *http.Client)

Source from the content-addressed store, hash-verified

20
21// NewEncryptionKey for client secret
22func NewEncryptionKey(cmd *cobra.Command, client *http.Client) (ek encrypta.EncryptionKey, encryptSecret bool, err error) {
23 if client == nil {
24 client = http.DefaultClient
25 }
26
27 pgpKey := flagx.MustGetString(cmd, FlagEncryptionPGPKey)
28 pgpKeyURL := flagx.MustGetString(cmd, FlagEncryptionPGPKeyURL)
29 keybaseUsername := flagx.MustGetString(cmd, FlagEncryptionKeybase)
30
31 if pgpKey != "" {
32 ek, err = encrypta.NewPublicKeyFromBase64Encoded(pgpKey)
33 encryptSecret = true
34 return
35 }
36
37 if pgpKeyURL != "" {
38 ek, err = encrypta.NewPublicKeyFromURL(pgpKeyURL, encrypta.HTTPClientOption(client))
39 encryptSecret = true
40 return
41 }
42
43 if keybaseUsername != "" {
44 ek, err = encrypta.NewPublicKeyFromKeybase(keybaseUsername, encrypta.HTTPClientOption(client))
45 encryptSecret = true
46 return
47 }
48
49 return nil, false, nil
50}

Callers 3

NewUpdateClientCmdFunction · 0.92
NewCreateClientsCommandFunction · 0.92
NewImportClientCmdFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected