code: func (r *CheckCertificateRPC) CheckCertificate(c context.Context, req *admin.CheckCertificateRequest) (*admin.CheckCertificateResponse, error) {
  	// Deserialize the cert.
  	der, err := utils.ParsePEM(req.CertPem, "CERTIFICATE")
  	if err != nil {
  		return nil, status.Errorf(codes.InvalidArgument, "can't parse 'cert_pem' - %s", err)
  	}
  	cert, err := x509.ParseCertificate(der)
  	if err != nil {
  		return nil, status.Errorf(codes.InvalidArgument, "can't parse 'cert-pem' - %s", err)
  	}
  
  	// Find a checker for the CA that signed the cert, check the certificate.
  	checker, err := GetCertChecker(c, cert.Issuer.CommonName)
  	if err == nil {
  		_, err = checker.CheckCertificate(c, cert)
  		if err == nil {
  			return &admin.CheckCertificateResponse{
  				IsValid: true,
  			}, nil
  		}
  	}
  
  	// Recognize error codes related to CA cert checking. Everything else is
  	// transient errors.
  	if details, ok := err.(Error); ok {
  		return &admin.CheckCertificateResponse{
  			IsValid:       false,
  			InvalidReason: details.Error(),
  		}, nil
  	}
  	return nil, status.Errorf(codes.Internal, "failed to check the certificate - %s", err)
  }
docs: // CheckCertificate says whether a certificate is valid or not.