keys

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BCRYPT_DSA_PRIVATE_KEY

type BCRYPT_DSA_PRIVATE_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_DSA_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_DSA_PRIVATE_BLOB
}

func (*BCRYPT_DSA_PRIVATE_KEY) Describe

func (k *BCRYPT_DSA_PRIVATE_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_DSA_PRIVATE_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_DSA_PRIVATE_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_DSA_PRIVATE_KEY) Marshal

func (k *BCRYPT_DSA_PRIVATE_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_DSA_PRIVATE_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_DSA_PRIVATE_KEY structure.

func (*BCRYPT_DSA_PRIVATE_KEY) Unmarshal

func (k *BCRYPT_DSA_PRIVATE_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_DSA_PRIVATE_KEY structure.

Parameters: - value: A byte slice containing the raw DSA PRIVATE key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the RSA PRIVATE key format, starting with the BCRYPT_RSA_KEY_BLOB header. It extracts the PRIVATE exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PRIVATE_KEY structure.

type BCRYPT_DSA_PUBLIC_KEY

type BCRYPT_DSA_PUBLIC_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_DSA_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_DSA_PUBLIC_BLOB
}

func (*BCRYPT_DSA_PUBLIC_KEY) Describe

func (k *BCRYPT_DSA_PUBLIC_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_DSA_PUBLIC_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_DSA_PUBLIC_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_DSA_PUBLIC_KEY) Marshal

func (k *BCRYPT_DSA_PUBLIC_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_DSA_PUBLIC_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_DSA_PUBLIC_KEY structure.

func (*BCRYPT_DSA_PUBLIC_KEY) Unmarshal

func (k *BCRYPT_DSA_PUBLIC_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_DSA_PUBLIC_KEY structure.

Parameters: - value: A byte slice containing the raw DSA public key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header. It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_DSA_PUBLIC_KEY structure.

type BCRYPT_ECC_PRIVATE_KEY added in v1.0.7

type BCRYPT_ECC_PRIVATE_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_ECC_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_ECC_PRIVATE_BLOB
}

func (*BCRYPT_ECC_PRIVATE_KEY) Describe added in v1.0.7

func (k *BCRYPT_ECC_PRIVATE_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_ECC_PRIVATE_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_ECC_PRIVATE_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_ECC_PRIVATE_KEY) Marshal added in v1.0.7

func (k *BCRYPT_ECC_PRIVATE_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_ECC_PRIVATE_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_ECC_PRIVATE_KEY structure.

func (*BCRYPT_ECC_PRIVATE_KEY) Unmarshal added in v1.0.7

func (k *BCRYPT_ECC_PRIVATE_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_ECC_PRIVATE_KEY structure.

Parameters: - value: A byte slice containing the raw ECC private key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the ECC private key format, starting with the BCRYPT_ECC_KEY_BLOB header. It extracts the X, Y and D big-endian values from the byte slice and stores them in the BCRYPT_ECC_PRIVATE_KEY structure.

type BCRYPT_ECC_PUBLIC_KEY added in v1.0.7

type BCRYPT_ECC_PUBLIC_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_ECC_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_ECC_PUBLIC_BLOB
}

func (*BCRYPT_ECC_PUBLIC_KEY) Describe added in v1.0.7

func (k *BCRYPT_ECC_PUBLIC_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_ECC_PUBLIC_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_ECC_PUBLIC_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_ECC_PUBLIC_KEY) Marshal added in v1.0.7

func (k *BCRYPT_ECC_PUBLIC_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_ECC_PUBLIC_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_ECC_PUBLIC_KEY structure.

func (*BCRYPT_ECC_PUBLIC_KEY) Unmarshal added in v1.0.7

func (k *BCRYPT_ECC_PUBLIC_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_ECC_PUBLIC_KEY structure.

Parameters: - value: A byte slice containing the raw ECC public key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the ECC public key format, starting with the BCRYPT_ECC_KEY_BLOB header. It extracts the X and Y big-endian values from the byte slice and stores them in the BCRYPT_ECC_PUBLIC_KEY structure.

type BCRYPT_RSA_PRIVATE_KEY added in v1.0.7

type BCRYPT_RSA_PRIVATE_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_RSA_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_RSA_PRIVATE_BLOB
}

func (*BCRYPT_RSA_PRIVATE_KEY) Describe added in v1.0.7

func (k *BCRYPT_RSA_PRIVATE_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_RSA_PRIVATE_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_RSA_PRIVATE_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_RSA_PRIVATE_KEY) Marshal added in v1.0.7

func (k *BCRYPT_RSA_PRIVATE_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_RSA_PRIVATE_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_RSA_PRIVATE_KEY structure.

func (*BCRYPT_RSA_PRIVATE_KEY) Unmarshal added in v1.0.7

func (k *BCRYPT_RSA_PRIVATE_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_RSA_PRIVATE_KEY structure.

Parameters: - value: A byte slice containing the raw RSA private key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the RSA private key format, starting with the BCRYPT_RSA_KEY_BLOB header. It extracts the public exponent, modulus, prime1, and prime2 from the byte slice and stores them in the BCRYPT_RSA_PRIVATE_KEY structure.

type BCRYPT_RSA_PUBLIC_KEY added in v1.0.7

type BCRYPT_RSA_PUBLIC_KEY struct {
	// Magic is the magic signature of the key.
	Magic magic.BCRYPT_KEY_BLOB

	// Header is the header of the key.
	Header headers.BCRYPT_RSA_KEY_BLOB

	// Content is the content of the key.
	Content blob.BCRYPT_RSA_PUBLIC_BLOB
}

func (*BCRYPT_RSA_PUBLIC_KEY) Describe added in v1.0.7

func (k *BCRYPT_RSA_PUBLIC_KEY) Describe(indent int)

Describe prints a detailed description of the BCRYPT_RSA_PUBLIC_KEY structure.

Parameters: - indent: An integer representing the indentation level for the printed output.

Note: The function prints the Header and Data of the BCRYPT_RSA_PUBLIC_KEY structure. The output is formatted with the specified indentation level to improve readability.

func (*BCRYPT_RSA_PUBLIC_KEY) Equal added in v1.0.7

Equal checks if two BCRYPT_RSA_PUBLIC_KEY structures are equal.

Parameters: - other: The BCRYPT_RSA_PUBLIC_KEY structure to compare to.

Returns: - True if the two BCRYPT_RSA_PUBLIC_KEY structures are equal, false otherwise.

func (*BCRYPT_RSA_PUBLIC_KEY) Marshal added in v1.0.7

func (k *BCRYPT_RSA_PUBLIC_KEY) Marshal() ([]byte, error)

Marshal returns the raw bytes of the BCRYPT_RSA_PUBLIC_KEY structure.

Returns: - A byte slice representing the raw bytes of the BCRYPT_RSA_PUBLIC_KEY structure.

func (*BCRYPT_RSA_PUBLIC_KEY) Unmarshal added in v1.0.7

func (k *BCRYPT_RSA_PUBLIC_KEY) Unmarshal(value []byte) (int, error)

Unmarshal parses the provided byte slice into the BCRYPT_RSA_PUBLIC_KEY structure.

Parameters: - value: A byte slice containing the raw RSA public key to be parsed.

Returns: - The number of bytes read from the byte slice. - An error if the parsing fails, otherwise nil.

Note: The function expects the byte slice to follow the RSA public key format, starting with the BCRYPT_RSA_KEY_BLOB header. It extracts the public exponent and modulus from the byte slice and stores them in the BCRYPT_RSA_PUBLIC_KEY structure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL