Documentation
¶
Index ¶
- Variables
- func ApprovedCipherSuites() map[string]uint16
- func ApprovedHashAlgorithms() map[string]string
- func ApprovedKeyExchanges() map[string]bool
- func Configure(level Level, opts ...Option) error
- func GenerateRSAKey(bits int) (*rsa.PrivateKey, error)
- func GetAuditLog() []string
- func GetTLSConfig(minVersion uint16) *tls.Config
- func IsEnabled() bool
- func MinimumKeySizes() map[string]int
- func SelfTest() error
- func ValidateHashAlgorithm(name string) error
- func ValidateKeySize(algorithm string, size int) error
- type CheckStatus
- type ComplianceCheck
- type ComplianceReport
- type Level
- type Mode
- type Option
Constants ¶
This section is empty.
Variables ¶
var ( CurrentMode = &Mode{ Level: LevelNone, Enabled: false, ApprovedOnly: true, AuditEnabled: false, ModuleValidated: false, } )
CurrentMode is the global FIPS mode configuration
Functions ¶
func ApprovedCipherSuites ¶
ApprovedCipherSuites returns FIPS-approved TLS cipher suites
func ApprovedHashAlgorithms ¶
ApprovedHashAlgorithms returns FIPS-approved hash algorithms
func ApprovedKeyExchanges ¶
ApprovedKeyExchanges returns FIPS-approved key exchange algorithms
func GenerateRSAKey ¶
func GenerateRSAKey(bits int) (*rsa.PrivateKey, error)
GenerateRSAKey generates an FIPS-compliant RSA key
func GetTLSConfig ¶
GetTLSConfig returns an FIPS-compliant TLS configuration
func MinimumKeySizes ¶
MinimumKeySizes returns minimum approved key sizes (bits)
func SelfTest ¶
func SelfTest() error
SelfTest performs a cryptographic self-test as required by FIPS
func ValidateHashAlgorithm ¶
ValidateHashAlgorithm validates that a hash algorithm is FIPS-approved
func ValidateKeySize ¶
ValidateKeySize validates that a key size meets FIPS requirements
Types ¶
type CheckStatus ¶
type CheckStatus string
CheckStatus represents the status of a compliance check
const ( CheckPass CheckStatus = "PASS" CheckFail CheckStatus = "FAIL" CheckWarning CheckStatus = "WARNING" CheckSkip CheckStatus = "SKIP" )
type ComplianceCheck ¶
type ComplianceCheck struct {
Name string
Status CheckStatus
Description string
Details string
}
ComplianceCheck represents a single compliance check
type ComplianceReport ¶
type ComplianceReport struct {
Timestamp time.Time
FIPSLevel Level
Passed bool
Checks []ComplianceCheck
Recommendations []string
}
ComplianceReport contains the results of a FIPS compliance check
func (*ComplianceReport) String ¶
func (r *ComplianceReport) String() string
String returns a human-readable representation of the compliance report
type Mode ¶
type Mode struct {
Level Level
Enabled bool
ApprovedOnly bool // Use only FIPS-approved algorithms
AuditEnabled bool // Log all cryptographic operations
ModuleValidated bool // Whether using a validated cryptographic module
ValidationNumber string // CMVP validation number (if certified)
}
Mode represents the current FIPS operational mode
type Option ¶
type Option func(*Mode)
Option is a functional option for configuring FIPS mode
func WithModuleValidation ¶
WithModuleValidation sets the module validation status