Documentation ¶
Index ¶
- Constants
- type CertRef
- type CertStore
- type IPFSCertStore
- type Lookup
- type LookupType
- type PublishRequest
- type Server
- func (s *Server) GetRevoke(ctx context.Context, id []byte) ([]byte, error)
- func (s *Server) GetRevokeSignature(ctx context.Context, id []byte, parent []byte) ([]byte, error)
- func (s *Server) Revoke(ctx context.Context, c *cki.Certificate, sig []byte) error
- func (s *Server) RevokeSignature(ctx context.Context, c *cki.Certificate, sig []byte) error
- func (s *Server) Start() error
Constants ¶
const ( //RefLookup represents a public reference of an certificate (IPFS block addr) RefLookup = "ref" //CertIDLookup represents a lookup against the certificates ID CertIDLookup = "id" //EmailLookup represents a lookup against any stored email in a certificate EmailLookup = "email" )
const (
//DefaultIPFSConfigPath default config path for IPFS node
DefaultIPFSConfigPath = "~/.ocs/ipfs/"
)
const (
//OCSCertificateMIME MIME type which can be used in web requests/responses
OCSCertificateMIME = "application/x-ocs-certificate"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertRef ¶
type CertRef struct { Ref string `msgpack:"r"` Signature []byte `msgpack:"s"` Nonce []byte `msgpack:"n"` }
CertRef represents a certificate reference structure
type CertStore ¶
type CertStore interface { Lookup(context.Context, *Lookup) (io.Reader, error) Publish(context.Context, *cki.Certificate, *PublishRequest) (string, error) }
CertStore provides a means of finding certificates
type IPFSCertStore ¶
type IPFSCertStore struct {
// contains filtered or unexported fields
}
IPFSCertStore uses IPFS to create a certificate store
func (*IPFSCertStore) Lookup ¶
Lookup attempts to find a certificate based on the lookup request. The IPFS DHT may be used to search for certificate IDs or emails, otherwise block lookup is used.
func (*IPFSCertStore) Publish ¶
func (scs *IPFSCertStore) Publish(ctx context.Context, c *cki.Certificate, r *PublishRequest) (string, error)
Publish publishes a certificate based on a signed public request
type Lookup ¶
type Lookup struct { LookupType LookupType `json:"t" msgpack:"t"` Data []byte `json:"d" msgpack:"d"` }
Lookup represents a lookup request data
type PublishRequest ¶
type PublishRequest struct { Cert []byte `msgpack:"c" json:"c"` Signature []byte `msgpack:"s" json:"s"` Nonce []byte `msgpack:"n" json:"n"` }
PublishRequest represents a certificate publish request
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server a OCS-CDI node implementation
func (*Server) GetRevokeSignature ¶
GetRevokeSignature searches for a signature revoke in the DHT TODO(tcfw)
func (*Server) Revoke ¶
Revoke stores a revoke certificate with signature to verify the revocation TODO(tcfw)
func (*Server) RevokeSignature ¶
RevokeSignature revokes an individual signature on a certificate for use in Multi-PKI mode TODO(tcfw)