Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 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())
Ejemplo n.º 3
0
    def perspective_node_crypto_tokens(params):
        """Gets the node's public crypto tokens.

    """
        token_requests = params[0]
        return backend.GetCryptoTokens(token_requests)
Ejemplo n.º 4
0
 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)