@@ -0,0 +1,1768 @@
+/**%0A* OpenCPS PKI is the open source PKI Integration software%0A* Copyright (C) 2016-present OpenCPS community%0A%0A* This program is free software: you can redistribute it and/or modify%0A* it under the terms of the GNU Affero General Public License as published by%0A* the Free Software Foundation, either version 3 of the License, or%0A* any later version.%0A%0A* This program is distributed in the hope that it will be useful,%0A* but WITHOUT ANY WARRANTY; without even the implied warranty of%0A* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A* GNU Affero General Public License for more details.%0A* You should have received a copy of the GNU Affero General Public License%0A* along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E%0A*/%0Apackage org.opencps.pki;%0A%0Aimport static org.mockito.Mockito.mock;%0A%0Aimport java.io.InputStream;%0Aimport java.security.GeneralSecurityException;%0Aimport java.util.Random;%0A%0Aimport com.itextpdf.text.pdf.security.ExternalSignatureContainer;%0A%0Aimport junit.framework.Test;%0Aimport junit.framework.TestCase;%0Aimport junit.framework.TestSuite;%0A%0A/**%0A * @author Nguyen Van Nguyen %3Cnguyennv@iwayvietnam.com%3E%0A */%0Apublic class ClientSignatureContainerTest extends TestCase %7B%0A%0A    public ClientSignatureContainerTest(String testName) %7B%0A        super(testName);%0A    %7D%0A%0A    /**%0A     * @return the suite of tests being tested%0A     */%0A    public static Test suite()%0A    %7B%0A        return new TestSuite(ClientSignatureContainerTest.class);%0A    %7D%0A    %0A    public void testSignatureContainer() throws GeneralSecurityException %7B%0A        byte%5B%5D b = new byte%5B20%5D;%0A        new Random().nextBytes(b);%0A        ExternalSignatureContainer container = new ClientSignatureContainer(b);%0A        assertEquals(b, container.sign(mock(InputStream.class)));%0A    %7D%0A%7D%0A

Add ClientSignatureContainerTest