forked from apptainer/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
key_newpair.go
33 lines (28 loc) · 990 Bytes
/
key_newpair.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2017-2019, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
package cli
import (
"github.com/spf13/cobra"
"github.com/sylabs/singularity/docs"
"github.com/sylabs/singularity/internal/pkg/sylog"
"github.com/sylabs/singularity/pkg/sypgp"
)
func init() {
KeyNewPairCmd.Flags().SetInterspersed(false)
}
// KeyNewPairCmd is `singularity key newpair' and generate a new OpenPGP key pair
var KeyNewPairCmd = &cobra.Command{
Args: cobra.ExactArgs(0),
DisableFlagsInUseLine: true,
Run: func(cmd *cobra.Command, args []string) {
if _, err := sypgp.GenKeyPair(); err != nil {
sylog.Fatalf("creating newpair failed: %v", err)
}
},
Use: docs.KeyNewPairUse,
Short: docs.KeyNewPairShort,
Long: docs.KeyNewPairLong,
Example: docs.KeyNewPairExample,
}