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