FileDocCategorySizeDatePackage
SymmetricKeyGenerationTest.javaAPI DocExample4165Tue May 29 16:57:44 BST 2007com.sun.xml.wss.impl

SymmetricKeyGenerationTest

public class SymmetricKeyGenerationTest extends TestCase
author
ashutosh.shahi@sun.com

Fields Summary
Constructors Summary
public SymmetricKeyGenerationTest(String testName)
Creates a new instance of SymmetricKeyGenerationTest

        super(testName);
    
Methods Summary
protected voidsetUp()

	    
    
public static junit.framework.Testsuite()

        TestSuite suite = new TestSuite(EndorsingSignatureTest.class);
                                                                                                                                                             
        return suite;
    
protected voidtearDown()

    
public static voidtestSymmetricKeyGenerationTest()

            String algorithm = MessageConstants.AES_BLOCK_ENCRYPTION_256;
            byte[] secret = "randombytes".getBytes();
            long offset = 0;
            long length = SecurityUtil.getLengthFromAlgorithm(algorithm);
            DerivedKeyToken dkt = new DerivedKeyTokenImpl(offset, length, secret);
            SecretKey sKey = dkt.generateSymmetricKey(algorithm);
            assertEquals(sKey.getEncoded().length, length);