1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package edu.internet2.middleware.shibboleth.common.config.security;
19
20 import java.io.FileInputStream;
21 import java.io.IOException;
22
23 import javax.xml.namespace.QName;
24
25 import org.springframework.beans.FatalBeanException;
26
27
28
29
30 public class FilesystemPKIXValidationInformationBeanDefinitionParser
31 extends AbstractPKIXValidationInformationBeanDefinitionParser {
32
33
34 public static final QName SCHEMA_TYPE = new QName(SecurityNamespaceHandler.NAMESPACE, "PKIXFilesystem");
35
36
37 protected byte[] getEncodedCRL(String certCRLContent) {
38 try {
39 FileInputStream ins = new FileInputStream(certCRLContent);
40 byte[] encoded = new byte[ins.available()];
41 ins.read(encoded);
42 return encoded;
43 } catch (IOException e) {
44 throw new FatalBeanException("Unable to read CRL(s) from file " + certCRLContent, e);
45 }
46 }
47
48
49 protected byte[] getEncodedCertificate(String certConfigContent) {
50 try {
51 FileInputStream ins = new FileInputStream(certConfigContent);
52 byte[] encoded = new byte[ins.available()];
53 ins.read(encoded);
54 return encoded;
55 } catch (IOException e) {
56 throw new FatalBeanException("Unable to read certificate(s) from file " + certConfigContent, e);
57 }
58 }
59
60 }