| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
package org.kuali.rice.ksb.security; |
| 18 |
|
|
| 19 |
|
import java.security.Signature; |
| 20 |
|
import java.security.cert.Certificate; |
| 21 |
|
|
| 22 |
|
import javax.servlet.http.HttpServletResponse; |
| 23 |
|
|
| 24 |
|
import org.apache.commons.lang.StringUtils; |
| 25 |
|
import org.kuali.rice.ksb.util.KSBConstants; |
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
@author |
| 31 |
|
|
|
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 6 |
Complexity Density: 0.46 |
|
| 32 |
|
public class ResponseHeaderDigitalSigner extends AbstractDigitalSigner { |
| 33 |
|
|
| 34 |
|
private String alias; |
| 35 |
|
private Certificate certificate; |
| 36 |
|
private HttpServletResponse response; |
| 37 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 38 |
0
|
public ResponseHeaderDigitalSigner(Signature signature, String alias, HttpServletResponse response) {... |
| 39 |
0
|
super(signature); |
| 40 |
0
|
this.alias = alias; |
| 41 |
0
|
this.response = response; |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 44 |
0
|
public ResponseHeaderDigitalSigner(Signature signature, String alias, Certificate certificate, HttpServletResponse response) {... |
| 45 |
0
|
this(signature, alias, response); |
| 46 |
0
|
this.certificate = certificate; |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 49 |
0
|
public ResponseHeaderDigitalSigner(Signature signature, Certificate certificate, HttpServletResponse response) {... |
| 50 |
0
|
super(signature); |
| 51 |
0
|
this.certificate = certificate; |
| 52 |
0
|
this.response = response; |
| 53 |
|
} |
| 54 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 55 |
0
|
public void sign() throws Exception {... |
| 56 |
0
|
if (StringUtils.isNotBlank(this.alias) ) { |
| 57 |
0
|
this.response.setHeader(KSBConstants.KEYSTORE_ALIAS_HEADER, this.alias); |
| 58 |
|
} |
| 59 |
0
|
if (this.certificate != null) { |
| 60 |
0
|
this.response.setHeader(KSBConstants.KEYSTORE_CERTIFICATE_HEADER, getEncodedCertificate(this.certificate)); |
| 61 |
|
} |
| 62 |
0
|
this.response.setHeader(KSBConstants.DIGITAL_SIGNATURE_HEADER, getEncodedSignature()); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
} |