コード例 #1
0
 def testRsaSpecificValues(self):
   self.assertRaises(errors.OpPrereqError, ssh.DetermineKeyBits, "dsa", 766,
                     None, None)
   for b in [768, 769, 2048, 2049, 4096]:
     self.assertEquals(b, ssh.DetermineKeyBits("rsa", b, None, None))
コード例 #2
0
 def testEcdsaSpecificValues(self):
   self.assertRaises(errors.OpPrereqError, ssh.DetermineKeyBits, "ecdsa", 2048,
                     None, None)
   for b in [256, 384, 521]:
     self.assertEquals(b, ssh.DetermineKeyBits("ecdsa", b, None, None))
コード例 #3
0
 def testAdoptOldKeySize(self):
   self.assertEquals(4098, ssh.DetermineKeyBits("rsa", None, "rsa", 4098))
   self.assertEquals(2048, ssh.DetermineKeyBits("rsa", None, "dsa", 1024))
コード例 #4
0
 def testDsaSpecificValues(self):
   self.assertRaises(errors.OpPrereqError, ssh.DetermineKeyBits, "dsa", 2048,
                     None, None)
   self.assertRaises(errors.OpPrereqError, ssh.DetermineKeyBits, "dsa", 512,
                     None, None)
   self.assertEquals(1024, ssh.DetermineKeyBits("dsa", None, None, None))
コード例 #5
0
 def testAdoptDefault(self):
   self.assertEquals(2048, ssh.DetermineKeyBits("rsa", None, None, None))
   self.assertEquals(1024, ssh.DetermineKeyBits("dsa", None, None, None))