Bouncy Castle Cryptography Library 1.86

org.bouncycastle.crypto.test
Class SM9KeyExchangeTest

java.lang.Object
  extended byorg.bouncycastle.util.test.SimpleTest
      extended byorg.bouncycastle.crypto.test.SM9KeyExchangeTest
All Implemented Interfaces:
Test

public class SM9KeyExchangeTest
extends SimpleTest

Known-answer test for the SM9 key exchange protocol (GM/T 0044.3-2016) against both official GM/T 0044.5-2016 Annex B vectors - the Chinese edition's example (hid = 0x02, crypto/sm9/sm9_keyexchange.txt) and the official English edition's example (hid = 0x03, crypto/sm9/sm9_keyexchange_hid03.txt); the hid is the KGC's published choice, taken from the vector file. For each, the master public key, both KGC-derived user keys, both parties' ephemeral values, the shared key and the key-confirmation tags S_A / S_B are reproduced byte-for-byte - with party A running on a key rebuilt through fromEncodedExchangeKey, the import path for a party holding its KGC-served key but not the master private key.


Nested Class Summary
 
Nested classes inherited from class org.bouncycastle.util.test.SimpleTest
SimpleTest.TestExceptionOperation
 
Constructor Summary
SM9KeyExchangeTest()
           
 
Method Summary
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
 void performTest()
           
 
Methods inherited from class org.bouncycastle.util.test.SimpleTest
areEqual, areEqual, areEqual, fail, fail, fail, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isEquals, isTrue, isTrue, perform, runTest, runTest, runTests, runTests, testException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SM9KeyExchangeTest

public SM9KeyExchangeTest()
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface Test
Specified by:
getName in class SimpleTest

performTest

public void performTest()
                 throws java.lang.Exception
Specified by:
performTest in class SimpleTest
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)

Bouncy Castle Cryptography Library 1.86