-
Notifications
You must be signed in to change notification settings - Fork 20
/
api.go
32 lines (29 loc) · 1 KB
/
api.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
// Package twofa contains routines for getting short lived certificate.
package twofa
import (
"crypto"
"crypto/x509"
"flag"
"github.com/Symantec/Dominator/lib/log"
"time"
)
var (
// Duration of generated cert. Default 16 hours.
Duration = flag.Duration("duration", 16*time.Hour, "Duration of the requested certificates in golang duration format (ex: 30s, 5m, 12h)")
// If set, Do not use U2F as second factor
noU2F = flag.Bool("noU2F", false, "Don't use U2F as second factor")
// If set, Do not use VIPAccess as second factor.
noVIPAccess = flag.Bool("noVIPAccess", false, "Don't use VIPAccess as second factor")
)
// GetCertFromTargetUrls gets a signed cert from the given target URLs.
func GetCertFromTargetUrls(
signer crypto.Signer,
userName string,
password []byte,
targetUrls []string,
rootCAs *x509.CertPool,
skipu2f bool,
logger log.DebugLogger) (sshCert []byte, x509Cert []byte, err error) {
return getCertFromTargetUrls(
signer, userName, password, targetUrls, rootCAs, skipu2f, logger)
}