1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.signature.validator;
18
19 import org.opensaml.xml.signature.X509IssuerSerial;
20 import org.opensaml.xml.validation.ValidationException;
21 import org.opensaml.xml.validation.Validator;
22
23
24
25
26 public class X509IssuerSerialSchemaValidator implements Validator<X509IssuerSerial> {
27
28
29 public void validate(X509IssuerSerial xmlObject) throws ValidationException {
30 validateChildrenPresence(xmlObject);
31 }
32
33
34
35
36
37
38
39 protected void validateChildrenPresence(X509IssuerSerial xmlObject) throws ValidationException {
40 if (xmlObject.getX509IssuerName() == null) {
41 throw new ValidationException("X509IssuerSerial does not contain an X509IssuerName");
42 }
43 if (xmlObject.getX509SerialNumber() == null) {
44 throw new ValidationException("X509IssuerSerial does not contain an X509SerialNumber");
45 }
46 }
47
48 }