1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.opensaml.xml.signature.impl;
18
19 import java.util.LinkedList;
20 import java.util.List;
21
22 import org.apache.xml.security.signature.XMLSignature;
23 import org.opensaml.xml.AbstractXMLObject;
24 import org.opensaml.xml.XMLObject;
25 import org.opensaml.xml.security.credential.Credential;
26 import org.opensaml.xml.signature.ContentReference;
27 import org.opensaml.xml.signature.KeyInfo;
28 import org.opensaml.xml.signature.Signature;
29
30
31
32
33 public class SignatureImpl extends AbstractXMLObject implements Signature {
34
35
36 private String canonicalizationAlgorithm;
37
38
39 private String signatureAlgorithm;
40
41
42 private Integer hmacOutputLength;
43
44
45 private Credential signingCredential;
46
47
48 private KeyInfo keyInfo;
49
50
51 private List<ContentReference> contentReferences;
52
53
54 private XMLSignature xmlSignature;
55
56
57
58
59
60
61
62
63 protected SignatureImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
64 super(namespaceURI, elementLocalName, namespacePrefix);
65 contentReferences = new LinkedList<ContentReference>();
66 }
67
68
69 public String getCanonicalizationAlgorithm() {
70 return canonicalizationAlgorithm;
71 }
72
73
74 public void setCanonicalizationAlgorithm(String newAlgorithm) {
75 canonicalizationAlgorithm = prepareForAssignment(canonicalizationAlgorithm, newAlgorithm);
76 }
77
78
79 public String getSignatureAlgorithm() {
80 return signatureAlgorithm;
81 }
82
83
84 public void setSignatureAlgorithm(String newAlgorithm) {
85 signatureAlgorithm = prepareForAssignment(signatureAlgorithm, newAlgorithm);
86 }
87
88
89 public Integer getHMACOutputLength() {
90 return hmacOutputLength;
91 }
92
93
94 public void setHMACOutputLength(Integer length) {
95 hmacOutputLength = prepareForAssignment(hmacOutputLength, length);
96 }
97
98
99 public Credential getSigningCredential() {
100 return signingCredential;
101 }
102
103
104 public void setSigningCredential(Credential newCredential) {
105 signingCredential = prepareForAssignment(signingCredential, newCredential);
106 }
107
108
109 public KeyInfo getKeyInfo() {
110 return keyInfo;
111 }
112
113
114 public void setKeyInfo(KeyInfo newKeyInfo) {
115 keyInfo = prepareForAssignment(keyInfo, newKeyInfo);
116 }
117
118
119 public List<ContentReference> getContentReferences() {
120
121
122 return contentReferences;
123 }
124
125
126 public List<XMLObject> getOrderedChildren() {
127
128 return null;
129 }
130
131
132 public void releaseDOM() {
133 super.releaseDOM();
134 xmlSignature = null;
135 }
136
137
138
139
140
141
142 public XMLSignature getXMLSignature(){
143 return xmlSignature;
144 }
145
146
147
148
149
150
151 public void setXMLSignature(XMLSignature signature){
152 xmlSignature = prepareForAssignment(xmlSignature, signature);
153 }
154 }