Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogLevel_None = 0 LogLevel_Error = 1 LogLevel_Warn = 2 LogLevel_Info = 3 LogLevel_Debug = 4 LogLevel_Trace = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager manages a pool of authenticated secure sessions with a YubiHSM2
func NewSessionManager ¶
func NewSessionManager(connector connector.Connector, authKeyID uint16, password string, logLevel int) (*SessionManager, error)
NewSessionManager creates a new instance of the SessionManager with poolSize connections. Wait on channel Connected with a timeout to wait for active connections to be ready.
func (*SessionManager) Destroy ¶
func (s *SessionManager) Destroy()
Destroy closes all connections in the pool. SessionManager instances can't be reused.
func (*SessionManager) GetSessionID ¶
func (s *SessionManager) GetSessionID() (uint8, error)
Returns the session ID. Will return 0 as the ID if there is an error.
func (*SessionManager) SendCommand ¶
func (s *SessionManager) SendCommand(c *commands.CommandMessage) (commands.Response, error)
SendCommand sends an unauthenticated command to the HSM and returns the parsed response
func (*SessionManager) SendEncryptedCommand ¶
func (s *SessionManager) SendEncryptedCommand(c *commands.CommandMessage) (commands.Response, error)
SendEncryptedCommand sends an encrypted & authenticated command to the HSM and returns the decrypted and parsed response.
Click to show internal directories.
Click to hide internal directories.