def testCreateSslToken(self): result = backend.GetCryptoTokens( [(constants.CRYPTO_TYPE_SSL_DIGEST, constants.CRYPTO_ACTION_CREATE, {constants.CRYPTO_OPTION_SERIAL_NO: 42})]) self.assertTrue((constants.CRYPTO_TYPE_SSL_DIGEST, self._ssl_digest) in result) self.assertTrue(utils.GenerateNewSslCert.assert_calls().once())
def testCreateSslTokenDifferentFilename(self): result = backend.GetCryptoTokens( [(constants.CRYPTO_TYPE_SSL_DIGEST, constants.CRYPTO_ACTION_CREATE, {constants.CRYPTO_OPTION_CERT_FILE: pathutils.NODED_CLIENT_CERT_FILE_TMP, constants.CRYPTO_OPTION_SERIAL_NO: 42})]) self.assertTrue((constants.CRYPTO_TYPE_SSL_DIGEST, self._ssl_digest) in result) self.assertTrue(utils.GenerateNewSslCert.assert_calls().once())
def perspective_node_crypto_tokens(params): """Gets the node's public crypto tokens. """ token_requests = params[0] return backend.GetCryptoTokens(token_requests)
def testGetSslToken(self): result = backend.GetCryptoTokens( [(constants.CRYPTO_TYPE_SSL_DIGEST, constants.CRYPTO_ACTION_GET, None)]) self.assertTrue((constants.CRYPTO_TYPE_SSL_DIGEST, self._ssl_digest) in result)