@Override protected void setUp() throws Exception { super.setUp(); signerInfo = new SignerInfo(HashAlgorithm.SHA256, ImmutableList.of(CertConstantUtil.SERVER_PUB_CERT, CertConstantUtil.INTERMEDIATE_PUB_CERT), DOMAIN); signer = new WaveSigner(SignatureAlgorithm.SHA1_RSA, CertConstantUtil.SERVER_PRIV_KEY, signerInfo); }
@Override protected void setUp() throws Exception { super.setUp(); signerInfo = new SignerInfo(HashAlgorithm.SHA256, ImmutableList.of(CertConstantUtil.SERVER_PUB_CERT, CertConstantUtil.INTERMEDIATE_PUB_CERT), DOMAIN); signer = new WaveSigner(SignatureAlgorithm.SHA1_RSA, CertConstantUtil.SERVER_PRIV_KEY, signerInfo); }
/** * Returns a WaveSigner. * @param privateKeyStream the stream from which to read the private key. The * key must be in PKCS#8-PEM-encoded format. * @param certStreams a list of streams from which to read the certificate * chain. The first stream in the list must have the target certificate * (i.e., the certificate issued to the signer). * @param domain The domain for which the certificate was issued. This should * match the CN in the targetcertificate. * @return a WaveSigner * @throws SignatureException if the private key or certificates cannot be * parsed. */ public WaveSigner getSigner(InputStream privateKeyStream, Iterable<? extends InputStream> certStreams, String domain) throws SignatureException { PrivateKey privateKey = getPrivateKey(privateKeyStream); List<X509Certificate> certs = getCertificates(certStreams); SignerInfo signerInfo = new SignerInfo(HashAlgorithm.SHA256, certs, domain); return new WaveSigner(SignatureAlgorithm.SHA1_RSA, privateKey, signerInfo); }