{"modulePath":"code.cloudfoundry.org/cli-sapi","version":"v6.1.1+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package ocsp\n\nPackage ocsp parses OCSP responses as specified in RFC 2560. OCSP responses are signed messages attesting to the validity of a certificate for a small period of time. This is used to manage revocation for X.509 certificates.\n\n## Constants\n\n```go\nconst (\n\t// Good means that the certificate is valid.\n\tGood = iota\n\t// Revoked means that the certificate has been deliberately revoked.\n\tRevoked = iota\n\t// Unknown means that the OCSP responder doesn't know about the certificate.\n\tUnknown = iota\n\t// ServerFailed means that the OCSP responder failed to process the request.\n\tServerFailed = iota\n)\n```\n\n## Functions\n\n```go\nfunc CreateRequest(cert, issuer *x509.Certificate, opts *RequestOptions) ([]byte, error)\n```\nCreateRequest returns a DER-encoded, OCSP request for the status of cert. If opts is nil then sensible defaults are used.\n\n## Types\n\n```go\ntype ParseError string\n```\nParseError results from an invalid OCSP response.\n\n```go\nfunc (p ParseError) Error() string\n```\n\n```go\ntype RequestOptions struct {\n\t// Hash contains the hash function that should be used when\n\t// constructing the OCSP request. If zero, SHA-1 will be used.\n\tHash crypto.Hash\n}\n```\nRequestOptions contains options for constructing OCSP requests.\n\n```go\ntype Response struct {\n\t// Status is one of {Good, Revoked, Unknown, ServerFailed}\n\tStatus                                        int\n\tSerialNumber                                  *big.Int\n\tProducedAt, ThisUpdate, NextUpdate, RevokedAt time.Time\n\tRevocationReason                              int\n\tCertificate                                   *x509.Certificate\n\t// TBSResponseData contains the raw bytes of the signed response. If\n\t// Certificate is nil then this can be used to verify Signature.\n\tTBSResponseData    []byte\n\tSignature          []byte\n\tSignatureAlgorithm x509.SignatureAlgorithm\n}\n```\nResponse represents an OCSP response. See RFC 2560.\n\n```go\nfunc ParseResponse(bytes []byte, issuer *x509.Certificate) (*Response, error)\n```\nParseResponse parses an OCSP response in DER form. It only supports responses for a single certificate. If the response contains a certificate then the signature over the response is checked. If issuer is not nil then it will be used to validate the signature or embedded certificate. Invalid signatures or parse failures will result in a ParseError.\n\n```go\nfunc (resp *Response) CheckSignatureFrom(issuer *x509.Certificate) error\n```\nCheckSignatureFrom checks that the signature in resp is a valid signature from issuer. This should only be used if resp.Certificate is nil. Otherwise, the OCSP response contained an intermediate certificate that created the signature. That signature is checked by ParseResponse and only resp.Certificate remains to be validated.\n\n","path":"code.cloudfoundry.org/cli-sapi/src/code.google.com/p/go.crypto/ocsp","name":"ocsp","synopsis":"Package ocsp parses OCSP responses as specified in RFC 2560.","isRedistributable":true}
