Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidBlockSize indicates hash blocksize <= 0. ErrInvalidBlockSize = errors.New("invalid blocksize") // ErrInvalidPKCS7Data indicates bad input to PKCS7 pad or unpad. ErrInvalidPKCS7Data = errors.New("invalid PKCS7 data (empty or not padded)") // ErrInvalidPKCS7Padding indicates PKCS7 unpad fails to bad input. ErrInvalidPKCS7Padding = errors.New("invalid padding on input") )
PKCS7 errors.
Functions ¶
This section is empty.
Types ¶
type BlockCipherEncoder ¶
type BlockCipherEncoder struct {
// contains filtered or unexported fields
}
BlockCipherEncoder can encode or decode data using a block cipher into a domain name
func NewBlockCipherEncoder ¶
func NewBlockCipherEncoder(domainName *pkg.DomainName, block cipher.Block) *BlockCipherEncoder
NewBlockCipherEncoder creates a new BlockCipherEncoder
func (*BlockCipherEncoder) Decode ¶
func (be *BlockCipherEncoder) Decode(src []byte) ([]byte, error)
Decode takes a domain name which contains a message encoded using a block cipher
func (*BlockCipherEncoder) Encode ¶
func (be *BlockCipherEncoder) Encode(src []byte) (string, error)
Encode encodes data into a domain name using a block cipher
func (*BlockCipherEncoder) MaxBytes ¶
func (be *BlockCipherEncoder) MaxBytes() int
MaxBytes is the maximum number of bytes that can be encoded into a single domain name taking the cipher block size and base domain name into account
Click to show internal directories.
Click to hide internal directories.