func()

in toolkit/certificates/certoperator/cert_operator.go [26:33]


func (o *certOperatorImp) pemToPrivateKey(ctx context.Context, raw string) (*rsa.PrivateKey, error) {
	kpb, _ := pem.Decode([]byte(raw))
	if kpb == nil {
		log.MustGetLogger(ctx).Errorf(ctx, "Decode returns nil")
		return nil, errors.New("The raw pem is not a valid PEM formatted block")
	}
	return x509.ParsePKCS1PrivateKey(kpb.Bytes)
}