Documentation
¶
Index ¶
- Constants
- func InitS3Options(id string, secret string, region string)
- func ParseRsaPrivateKey(bytes []byte) (*rsa.PrivateKey, error)
- func ParseX509Certificate(bytes []byte) (*x509.Certificate, error)
- type HMACSigner
- type HMACSignerV1
- type HMACSigningResult
- type HMACValidator
- type HMACValidatorV1
- type RSACert
- type RSACertAccessor
- type RSACertFileAccessor
- type RSACertIssuor
- type RSACertS3Accessor
- type RSAClient
- type RSADescriptor
- type RSADescriptorCollection
- type RSAServer
- type RSASigner
- type RSAStore
- type RSAStoreFactory
- type Request
- type S3Options
- type X509RSAStoreMode
- type X509Subject
Constants ¶
View Source
const (
HMACV1Scheme = "FNBUS1-HMAC-SHA256"
)
Variables ¶
This section is empty.
Functions ¶
func InitS3Options ¶
func ParseRsaPrivateKey ¶
func ParseRsaPrivateKey(bytes []byte) (*rsa.PrivateKey, error)
func ParseX509Certificate ¶
func ParseX509Certificate(bytes []byte) (*x509.Certificate, error)
Types ¶
type HMACSigner ¶
type HMACSigner interface {
Sign(r *Request, exp time.Duration) *HMACSigningResult
}
A HMACSigner is the interface for any component which will provide HMAC signature algorithm.
type HMACSignerV1 ¶
type HMACSignerV1 struct {
Key string
Identifier string
Logger *log.Logger
DisableHeaderHoisting bool
DisableURIPathEscaping bool
// contains filtered or unexported fields
}
func NewHMACSignerV1 ¶
func NewHMACSignerV1(id, key string, options ...func(*HMACSignerV1)) *HMACSignerV1
NewHMACSignerV1 returns a HMACSignerV1 pointer
func (*HMACSignerV1) Sign ¶
func (v1 *HMACSignerV1) Sign(r *Request, exp time.Duration) *HMACSigningResult
type HMACSigningResult ¶
SigningResult is a signing result strcuture
type HMACValidator ¶
A HMACValidator is the interface for any component which will provide HMAC signature validate.
type HMACValidatorV1 ¶
type HMACValidatorV1 struct {
Logger *log.Logger
DisableHeaderHoisting bool
DisableURIPathEscaping bool
// contains filtered or unexported fields
}
func NewHMACValidatorV1 ¶
func NewHMACValidatorV1(h func(string) (string, error), options ...func(*HMACValidatorV1)) *HMACValidatorV1
NewHMACValidatorV1 returns a HMACValidatorV1 pointer
func (*HMACValidatorV1) Verify ¶
func (v1 *HMACValidatorV1) Verify(r *Request) bool
type RSACert ¶
type RSACert interface {
GetSerialNumber() *big.Int
GetCertificate() *x509.Certificate
GetPrivateKey() *rsa.PrivateKey
GetCertificateBytes() []byte
GetPrivateKeyBytes() []byte
}
type RSACertAccessor ¶
func ParseS3URI ¶
func ParseS3URI(uri string) (RSACertAccessor, error)
ParseS3URI sample : s3://default/sampleBucket/?key=sampleKey&profile=Profile1 .
func ParseURI ¶
func ParseURI(urlStr string) (RSACertAccessor, error)
func ResolveFileURI ¶
func ResolveFileURI(uri string) (RSACertAccessor, error)
type RSACertFileAccessor ¶
type RSACertFileAccessor struct {
// contains filtered or unexported fields
}
func (*RSACertFileAccessor) Download ¶
func (u *RSACertFileAccessor) Download() ([]byte, error)
type RSACertIssuor ¶
type RSACertIssuor interface {
GetRootCert() RSACert
Issue(subject *X509Subject) (RSACert, error)
}
func Newx509RSACertIssuor ¶
func Newx509RSACertIssuor(root RSACert, priKey *rsa.PrivateKey) RSACertIssuor
type RSACertS3Accessor ¶
func (*RSACertS3Accessor) Download ¶
func (u *RSACertS3Accessor) Download() ([]byte, error)
func (*RSACertS3Accessor) Session ¶
func (u *RSACertS3Accessor) Session() *session.Session
type RSADescriptor ¶
type RSADescriptor interface {
PrivateKey() *rsa.PrivateKey
Certificate() string
ClientID() string
}
func Newx509RSADescriptor ¶
func Newx509RSADescriptor(clientID string, certificate string, privateKey *rsa.PrivateKey) RSADescriptor
type RSADescriptorCollection ¶
type RSADescriptorCollection struct {
// contains filtered or unexported fields
}
func NewRSADescriptorCollection ¶
func NewRSADescriptorCollection() *RSADescriptorCollection
func (*RSADescriptorCollection) AddOrReplace ¶
func (c *RSADescriptorCollection) AddOrReplace(item RSADescriptor)
func (*RSADescriptorCollection) AnyClientID ¶
func (c *RSADescriptorCollection) AnyClientID(clientID string) bool
func (*RSADescriptorCollection) FirstClientID ¶
func (c *RSADescriptorCollection) FirstClientID(clientID string) RSADescriptor
func (*RSADescriptorCollection) RemoveClientID ¶
func (c *RSADescriptorCollection) RemoveClientID(clientID string)
type RSAServer ¶
func Newx509RSAServer ¶
type RSASigner ¶
type RSASigner interface {
Sign(bytes []byte, key *rsa.PrivateKey) ([]byte, error)
}
func Newx509RSASigner ¶
func Newx509RSASigner() RSASigner
type RSAStore ¶
type RSAStore interface {
SetTag(tag string)
Tag() string
Certificate(clientID string) (RSADescriptor, error)
}
type RSAStoreFactory ¶
type RSAStoreFactory struct {
// contains filtered or unexported fields
}
func NewRSAStoreFactory ¶
func NewRSAStoreFactory(tag string, bucket string, rootCert RSACert, subject *X509Subject) *RSAStoreFactory
func NewRSAStoreFactoryFrom ¶
func NewRSAStoreFactoryFrom(tag string, bucket string, rootPriKeyUrl string, rootCertUrl string, subject *X509Subject) (*RSAStoreFactory, error)
func (*RSAStoreFactory) Create ¶
func (factory *RSAStoreFactory) Create(mode X509RSAStoreMode) (RSAStore, error)
type S3Options ¶
type S3Options struct {
// contains filtered or unexported fields
}
func GetS3Options ¶
func GetS3Options() *S3Options
func (*S3Options) GetAppSecret ¶
type X509RSAStoreMode ¶
type X509RSAStoreMode int
const ( X509RSAStore_OneToMany X509RSAStoreMode X509RSAStore_Test )
type X509Subject ¶
type X509Subject struct {
Country []string
Orianization []string
OrianizationalUnit []string
Province []string
CommonName string
Locality []string
NotBefore time.Time
NotAfter time.Time
ExtKeyUsage []x509.ExtKeyUsage
KeyUsage x509.KeyUsage
IsRoot bool
}
func GetDefaultSubject ¶
func GetDefaultSubject() *X509Subject
Source Files
¶
- hmac_header_rules.go
- hmac_v1_sign.go
- hmac_v1_verify.go
- rsa_cert.go
- rsa_cert_accessor.go
- rsa_cert_accessor_selector.go
- rsa_cert_file_accessor.go
- rsa_cert_issuor.go
- rsa_cert_s3_accessor.go
- rsa_client.go
- rsa_descriptor.go
- rsa_descriptor_collection.go
- rsa_server.go
- rsa_signer.go
- rsa_store.go
- s3_options.go
- signer.go
- x509_rsa_cert.go
- x509_rsa_cert_issuor.go
- x509_rsa_client.go
- x509_rsa_descriptor.go
- x509_rsa_server.go
- x509_rsa_signer.go
- x509_rsa_store.go
- x509_rsa_test_store.go
- x509_subject.go
Click to show internal directories.
Click to hide internal directories.