Documentation ¶
Index ¶
- Constants
- func Encrypt(config JWEConfig, payload string, header JOSEHeader) (string, error)
- type JOSEHeader
- type JWEConfig
- func (config *JWEConfig) GetCek() []byte
- func (config *JWEConfig) GetCertificate() *x509.Certificate
- func (config *JWEConfig) GetDecryptionKey() *rsa.PrivateKey
- func (config *JWEConfig) GetDecryptionPaths() map[string]string
- func (config *JWEConfig) GetEncryptedValueFieldName() string
- func (config *JWEConfig) GetEncryptionKey() *rsa.PublicKey
- func (config *JWEConfig) GetEncryptionKeyFingerprint() string
- func (config *JWEConfig) GetEncryptionPaths() map[string]string
- func (config *JWEConfig) GetIv() []byte
- type JWEConfigBuilder
- func (cb *JWEConfigBuilder) Build() *JWEConfig
- func (cb *JWEConfigBuilder) WithCek(cek []byte) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithCertificate(certificate *x509.Certificate) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithDecryptionKey(decryptionKey *rsa.PrivateKey) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithDecryptionPath(jsonPathIn, jsonPathOut string) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithEncryptedValueFieldName(encryptedValueFieldName string) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithEncryptionKey(encryptionKey *rsa.PublicKey) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithEncryptionPath(jsonPathIn, jsonPathOut string) *JWEConfigBuilder
- func (cb *JWEConfigBuilder) WithIv(iv []byte) *JWEConfigBuilder
- type JWEObject
Constants ¶
View Source
const ( A128CBC_HS256 = "A128CBC-HS256" A256GCM = "A256GCM" A128GCM = "A128GCM" A192GCM = "A192GCM" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JOSEHeader ¶
type JOSEHeader struct { Alg string `json:"alg"` Enc string `json:"enc"` Kid string `json:"kid"` Cty string `json:"cty"` }
func ParseJOSEHeader ¶
func ParseJOSEHeader(encodedHeader string) (*JOSEHeader, error)
func (JOSEHeader) ToJson ¶
func (header JOSEHeader) ToJson() ([]byte, error)
type JWEConfig ¶
type JWEConfig struct {
// contains filtered or unexported fields
}
func (*JWEConfig) GetCertificate ¶
func (config *JWEConfig) GetCertificate() *x509.Certificate
func (*JWEConfig) GetDecryptionKey ¶
func (config *JWEConfig) GetDecryptionKey() *rsa.PrivateKey
func (*JWEConfig) GetDecryptionPaths ¶
func (*JWEConfig) GetEncryptedValueFieldName ¶
func (*JWEConfig) GetEncryptionKey ¶
func (*JWEConfig) GetEncryptionKeyFingerprint ¶
func (*JWEConfig) GetEncryptionPaths ¶
type JWEConfigBuilder ¶
type JWEConfigBuilder struct {
// contains filtered or unexported fields
}
func NewJWEConfigBuilder ¶
func NewJWEConfigBuilder() *JWEConfigBuilder
func (*JWEConfigBuilder) Build ¶
func (cb *JWEConfigBuilder) Build() *JWEConfig
func (*JWEConfigBuilder) WithCek ¶
func (cb *JWEConfigBuilder) WithCek(cek []byte) *JWEConfigBuilder
func (*JWEConfigBuilder) WithCertificate ¶
func (cb *JWEConfigBuilder) WithCertificate(certificate *x509.Certificate) *JWEConfigBuilder
func (*JWEConfigBuilder) WithDecryptionKey ¶
func (cb *JWEConfigBuilder) WithDecryptionKey(decryptionKey *rsa.PrivateKey) *JWEConfigBuilder
func (*JWEConfigBuilder) WithDecryptionPath ¶
func (cb *JWEConfigBuilder) WithDecryptionPath(jsonPathIn, jsonPathOut string) *JWEConfigBuilder
func (*JWEConfigBuilder) WithEncryptedValueFieldName ¶
func (cb *JWEConfigBuilder) WithEncryptedValueFieldName(encryptedValueFieldName string) *JWEConfigBuilder
func (*JWEConfigBuilder) WithEncryptionKey ¶
func (cb *JWEConfigBuilder) WithEncryptionKey(encryptionKey *rsa.PublicKey) *JWEConfigBuilder
func (*JWEConfigBuilder) WithEncryptionPath ¶
func (cb *JWEConfigBuilder) WithEncryptionPath(jsonPathIn, jsonPathOut string) *JWEConfigBuilder
func (*JWEConfigBuilder) WithIv ¶
func (cb *JWEConfigBuilder) WithIv(iv []byte) *JWEConfigBuilder
type JWEObject ¶
type JWEObject struct { JoseHeader *JOSEHeader Aad string EncryptedKey string Iv string CipherText string AuthTag string }
func ParseJWEObject ¶
Click to show internal directories.
Click to hide internal directories.