func NewDefaultAuthorityPem(pemBlock []byte) (*DefaultAuthority, error) {
	leaf, err := NewDefaultLeafPem("", pemBlock)
	if err != nil {
		return nil, errors.Annotate(err, "generating CA leaf")
	}

	if !leaf.Certificate().IsCA {
		return nil, errors.Errorf("certificate %s is not a CA",
			leaf.Certificate().Subject.CommonName)
	}

	return NewDefaultAuthority(leaf.Certificate(), leaf.Signer(), leaf.Chain()...)
}
// NewDefaultAuthorityPem generates a new DefaultAuthority for the supplied pem
// block. The pem block must contain a valid CA certificate and associated
// private key.
NewDefaultAuthorityPem generates a new DefaultAuthority for the supplied pem
block. The pem block must contain a valid CA certificate and associated
private key.
// NewDefaultAuthorityPem generates a new DefaultAuthority for the supplied pem // block . The pem block must contain a valid CA certificate and associated // private key .
func NewDefaultAuthorityPem(pemBlock []byte) (*DefaultAuthority, error) {
	leaf, err := NewDefaultLeafPem("", pemBlock)
	if err != nil {
		return nil, errors.Annotate(err, "generating CA leaf")
	}
	if !leaf.Certificate().IsCA {
		return nil, errors.Errorf("certificate %s is not a CA",
			leaf.Certificate().Subject.CommonName)
	}
	return NewDefaultAuthority(leaf.Certificate(), leaf.Signer(), leaf.Chain()...)
}
func NewDefaultAuthorityPem ( pemBlock [ ] byte ) ( * DefaultAuthority , error ) { leaf , err := NewDefaultLeafPem ( " " , pemBlock ) if err != nil { return nil , errors . Annotate ( err , " " ) } if ! leaf . Certificate ( ) . IsCA { return nil , errors . Errorf ( " " , leaf . Certificate ( ) . Subject . CommonName ) } return NewDefaultAuthority ( leaf . Certificate ( ) , leaf . Signer ( ) , leaf . Chain ( ) ... ) }
NewDefaultAuthorityPem generates a new DefaultAuthority for the supplied pem
block.
NewDefaultAuthorityPem generates a new DefaultAuthority for the supplied pem block .