예제 #1
0
 def test_generate_public_and_private(self):
   pub, priv = ed25519_keys.generate_public_and_private()
   
   # Check format of 'pub' and 'priv'.
   self.assertEqual(True, tuf.formats.ED25519PUBLIC_SCHEMA.matches(pub))
   self.assertEqual(True, tuf.formats.ED25519SEED_SCHEMA.matches(priv))
예제 #2
0
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

import unittest
import os
import logging

import tuf
import tuf.log
import tuf.formats
import tuf.ed25519_keys as ed25519_keys 

logger = logging.getLogger('tuf.test_ed25519_keys')

public, private = ed25519_keys.generate_public_and_private()
FORMAT_ERROR_MSG = 'tuf.FormatError raised.  Check object\'s format.'


class TestEd25519_keys(unittest.TestCase):
  def setUp(self):
    pass


  def test_generate_public_and_private(self):
    pub, priv = ed25519_keys.generate_public_and_private()
    
    # Check format of 'pub' and 'priv'.
    self.assertEqual(True, tuf.formats.ED25519PUBLIC_SCHEMA.matches(pub))
    self.assertEqual(True, tuf.formats.ED25519SEED_SCHEMA.matches(priv))