32 import java.security.KeyException; |
32 import java.security.KeyException; |
33 import java.security.PublicKey; |
33 import java.security.PublicKey; |
34 import java.util.List; |
34 import java.util.List; |
35 import javax.xml.crypto.*; |
35 import javax.xml.crypto.*; |
36 import javax.xml.crypto.dom.DOMCryptoContext; |
36 import javax.xml.crypto.dom.DOMCryptoContext; |
|
37 import javax.xml.crypto.dsig.Transform; |
37 import javax.xml.crypto.dsig.keyinfo.*; |
38 import javax.xml.crypto.dsig.keyinfo.*; |
38 import org.w3c.dom.Document; |
39 import org.w3c.dom.Document; |
39 import org.w3c.dom.Element; |
40 import org.w3c.dom.Element; |
40 import org.w3c.dom.Node; |
41 import org.w3c.dom.Node; |
41 |
42 |
46 */ |
47 */ |
47 public final class DOMKeyInfoFactory extends KeyInfoFactory { |
48 public final class DOMKeyInfoFactory extends KeyInfoFactory { |
48 |
49 |
49 public DOMKeyInfoFactory() { } |
50 public DOMKeyInfoFactory() { } |
50 |
51 |
51 @SuppressWarnings("rawtypes") |
52 public KeyInfo newKeyInfo(List<? extends XMLStructure> content) { |
52 public KeyInfo newKeyInfo(List content) { |
|
53 return newKeyInfo(content, null); |
53 return newKeyInfo(content, null); |
54 } |
54 } |
55 |
55 |
56 @SuppressWarnings({ "unchecked", "rawtypes" }) |
56 public KeyInfo newKeyInfo(List<? extends XMLStructure> content, String id) { |
57 public KeyInfo newKeyInfo(List content, String id) { |
|
58 return new DOMKeyInfo(content, id); |
57 return new DOMKeyInfo(content, id); |
59 } |
58 } |
60 |
59 |
61 public KeyName newKeyName(String name) { |
60 public KeyName newKeyName(String name) { |
62 return new DOMKeyName(name); |
61 return new DOMKeyName(name); |
77 |
76 |
78 public PGPData newPGPData(byte[] keyId) { |
77 public PGPData newPGPData(byte[] keyId) { |
79 return newPGPData(keyId, null, null); |
78 return newPGPData(keyId, null, null); |
80 } |
79 } |
81 |
80 |
82 @SuppressWarnings({ "unchecked", "rawtypes" }) |
81 public PGPData newPGPData(byte[] keyId, byte[] keyPacket, |
83 public PGPData newPGPData(byte[] keyId, byte[] keyPacket, List other) { |
82 List<? extends XMLStructure> other) { |
84 return new DOMPGPData(keyId, keyPacket, other); |
83 return new DOMPGPData(keyId, keyPacket, other); |
85 } |
84 } |
86 |
85 |
87 @SuppressWarnings({ "unchecked", "rawtypes" }) |
86 public PGPData newPGPData(byte[] keyPacket, |
88 public PGPData newPGPData(byte[] keyPacket, List other) { |
87 List<? extends XMLStructure> other) { |
89 return new DOMPGPData(keyPacket, other); |
88 return new DOMPGPData(keyPacket, other); |
90 } |
89 } |
91 |
90 |
92 public RetrievalMethod newRetrievalMethod(String uri) { |
91 public RetrievalMethod newRetrievalMethod(String uri) { |
93 return newRetrievalMethod(uri, null, null); |
92 return newRetrievalMethod(uri, null, null); |
94 } |
93 } |
95 |
94 |
96 @SuppressWarnings({ "unchecked", "rawtypes" }) |
|
97 public RetrievalMethod newRetrievalMethod(String uri, String type, |
95 public RetrievalMethod newRetrievalMethod(String uri, String type, |
98 List transforms) { |
96 List<? extends Transform> transforms) { |
99 if (uri == null) { |
97 if (uri == null) { |
100 throw new NullPointerException("uri must not be null"); |
98 throw new NullPointerException("uri must not be null"); |
101 } |
99 } |
102 return new DOMRetrievalMethod(uri, type, transforms); |
100 return new DOMRetrievalMethod(uri, type, transforms); |
103 } |
101 } |
104 |
102 |
105 @SuppressWarnings("rawtypes") |
103 public X509Data newX509Data(List<?> content) { |
106 public X509Data newX509Data(List content) { |
|
107 return new DOMX509Data(content); |
104 return new DOMX509Data(content); |
108 } |
105 } |
109 |
106 |
110 public X509IssuerSerial newX509IssuerSerial(String issuerName, |
107 public X509IssuerSerial newX509IssuerSerial(String issuerName, |
111 BigInteger serialNumber) { |
108 BigInteger serialNumber) { |