// RevokeCert revokes a previously issued certificate cert, provided in DER format.
//
// The key argument, used to sign the request, must be authorized
// to revoke the certificate. It's up to the CA to decide which keys are authorized.
// For instance, the key pair of the certificate may be authorized.
// If the key is nil, c.Key is used instead.
RevokeCert revokes a previously issued certificate cert, provided in DER format.

The key argument, used to sign the request, must be authorized
to revoke the certificate. It's up to the CA to decide which keys are authorized.
For instance, the key pair of the certificate may be authorized.
If the key is nil, c.Key is used instead.
// RevokeCert revokes a previously issued certificate cert provided in DER format . // // The key argument used to sign the request must be authorized // to revoke the certificate . It ' s up to the CA to decide which keys are authorized . // For instance the key pair of the certificate may be authorized . // If the key is nil c . Key is used instead .
func (c *Client) RevokeCert(ctx context.Context, key crypto.Signer, cert []byte, reason CRLReasonCode) error {
	if _, err := c.Discover(ctx); err != nil {
		return err
	}
	body := &struct {
		Resource string `json:"resource"`
		Cert     string `json:"certificate"`
		Reason   int    `json:"reason"`
	}{
		Resource: "revoke-cert",
		Cert:     base64.RawURLEncoding.EncodeToString(cert),
		Reason:   int(reason),
	}
	if key == nil {
		key = c.Key
	}
	res, err := c.postJWS(ctx, key, c.dir.RevokeURL, body)
	if err != nil {
		return err
	}
	defer res.Body.Close()
	if res.StatusCode != http.StatusOK {
		return responseError(res)
	}
	return nil
}
func ( c * Client ) RevokeCert ( ctx context . Context , key crypto . Signer , cert [ ] byte , reason CRLReasonCode ) error { if _ , err := c . Discover ( ctx ) ; err != nil { return err } body := & struct { Resource string `json:"resource"` Cert string `json:"certificate"` Reason int `json:"reason"` } { Resource : " " , Cert : base64 . RawURLEncoding . EncodeToString ( cert ) , Reason : int ( reason ) , } if key == nil { key = c . Key } res , err := c . postJWS ( ctx , key , c . dir . RevokeURL , body ) if err != nil { return err } defer res . Body . Close ( ) if res . StatusCode != http . StatusOK { return responseError ( res ) } return nil }
RevokeCert revokes a previously issued certificate cert, provided in DER format.
RevokeCert revokes a previously issued certificate cert provided in DER format .