func (c *Claimer) MinTLSCertDuration() time.Duration {
	if c.claims == nil || c.claims.MinTLSDur == nil {
		if c.claims != nil && c.claims.DefaultTLSDur != nil && c.claims.DefaultTLSDur.Duration < c.global.MinTLSDur.Duration {
			return c.claims.DefaultTLSDur.Duration
		}
		return c.global.MinTLSDur.Duration
	}
	return c.claims.MinTLSDur.Duration
}
MinTLSCertDuration returns the minimum TLS cert duration for the provisioner.
If the minimum is not set within the provisioner, then the global
minimum from the authority configuration will be used.
package provisioner
import (
	"time"
	"github.com/pkg/errors"
	"golang.org/x/crypto/ssh"
)
type Claims struct {
	MinTLSDur      *Duration `json:"minTLSCertDuration,omitempty"`
	MaxTLSDur      *Duration `json:"maxTLSCertDuration,omitempty"`
	DefaultTLSDur  *Duration `json:"defaultTLSCertDuration,omitempty"`
	DisableRenewal *bool     `json:"disableRenewal,omitempty"`
	MinUserSSHDur     *Duration `json:"minUserSSHCertDuration,omitempty"`
	MaxUserSSHDur     *Duration `json:"maxUserSSHCertDuration,omitempty"`
	DefaultUserSSHDur *Duration `json:"defaultUserSSHCertDuration,omitempty"`
	MinHostSSHDur     *Duration `json:"minHostSSHCertDuration,omitempty"`
	MaxHostSSHDur     *Duration `json:"maxHostSSHCertDuration,omitempty"`
	DefaultHostSSHDur *Duration `json:"defaultHostSSHCertDuration,omitempty"`
	EnableSSHCA       *bool     `json:"enableSSHCA,omitempty"`
}
type Claimer struct {
	global Claims
	claims *Claims
}
func NewClaimer(claims *Claims, global Claims) (*Claimer, error) {
	c := &Claimer{global: global, claims: claims}
	return c, c.Validate()
}
func (c *Claimer) Claims() Claims {
	disableRenewal := c.IsDisableRenewal()
	enableSSHCA := c.IsSSHCAEnabled()
	return Claims{
		MinTLSDur:         &Duration{c.MinTLSCertDuration()},
		MaxTLSDur:         &Duration{c.MaxTLSCertDuration()},
		DefaultTLSDur:     &Duration{c.DefaultTLSCertDuration()},
		DisableRenewal:    &disableRenewal,
		MinUserSSHDur:     &Duration{c.MinUserSSHCertDuration()},
		MaxUserSSHDur:     &Duration{c.MaxUserSSHCertDuration()},
		DefaultUserSSHDur: &Duration{c.DefaultUserSSHCertDuration()},
		MinHostSSHDur:     &Duration{c.MinHostSSHCertDuration()},
		MaxHostSSHDur:     &Duration{c.MaxHostSSHCertDuration()},
		DefaultHostSSHDur: &Duration{c.DefaultHostSSHCertDuration()},
		EnableSSHCA:       &enableSSHCA,
	}
}
func (c *Claimer) DefaultTLSCertDuration() time.Duration {
	if c.claims == nil || c.claims.DefaultTLSDur == nil {
		return c.global.DefaultTLSDur.Duration
	}
	return c.claims.DefaultTLSDur.Duration
}