Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
CMSSignedDataVerifier | 38 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | ||
21 | package org.xwiki.crypto.signer; | |
22 | ||
23 | import java.security.GeneralSecurityException; | |
24 | import java.util.Collection; | |
25 | ||
26 | import org.xwiki.component.annotation.Role; | |
27 | import org.xwiki.crypto.pkix.CertificateProvider; | |
28 | import org.xwiki.crypto.pkix.params.CertifiedPublicKey; | |
29 | import org.xwiki.crypto.signer.param.CMSSignedDataVerified; | |
30 | ||
31 | /** | |
32 | * Verify SignedData according to RFC 3852. | |
33 | * | |
34 | * @version $Id: 0e01e41c656b9083b0f5e379b85dcd5f24b770ad $ | |
35 | * @since 6.0M1 | |
36 | */ | |
37 | @Role | |
38 | public interface CMSSignedDataVerifier | |
39 | { | |
40 | /** | |
41 | * Verify all signature contained in the signature against the embedded data. | |
42 | * | |
43 | * @param signature the encoded signature to verify. | |
44 | * @return the result of that verification, and information contained in the signed data. | |
45 | * @throws java.security.GeneralSecurityException on error. | |
46 | */ | |
47 | CMSSignedDataVerified verify(byte[] signature) throws GeneralSecurityException; | |
48 | ||
49 | /** | |
50 | * Verify all signature contained in the signature against the embedded data. | |
51 | * | |
52 | * @param signature the encoded signature to verify. | |
53 | * @param certificates additional certificates to proceed to the verification. | |
54 | * @return the result of that verification, and information contained in the signed data. | |
55 | * @throws java.security.GeneralSecurityException on error. | |
56 | */ | |
57 | CMSSignedDataVerified verify(byte[] signature, Collection<CertifiedPublicKey> certificates) | |
58 | throws GeneralSecurityException; | |
59 | ||
60 | /** | |
61 | * Verify all signature contained in the signature against the embedded data. | |
62 | * | |
63 | * @param signature the encoded signature to verify. | |
64 | * @param certificateProvider provider of additional certificate to proceed to the verification. | |
65 | * @return the result of that verification, and information contained in the signed data. | |
66 | * @throws java.security.GeneralSecurityException on error. | |
67 | */ | |
68 | CMSSignedDataVerified verify(byte[] signature, CertificateProvider certificateProvider) | |
69 | throws GeneralSecurityException; | |
70 | ||
71 | /** | |
72 | * Verify all signature contained in the signature against the provided data. | |
73 | * | |
74 | * @param signature the encoded signature to verify. | |
75 | * @param data the data to check the signature against. | |
76 | * @return the result of that verification, and information contained in the signed data. | |
77 | * @throws java.security.GeneralSecurityException on error. | |
78 | */ | |
79 | CMSSignedDataVerified verify(byte[] signature, byte[] data) throws GeneralSecurityException; | |
80 | ||
81 | /** | |
82 | * Verify all signature contained in the signature against the provided data. | |
83 | * | |
84 | * @param signature the encoded signature to verify. | |
85 | * @param data the data to check the signature against. | |
86 | * @param certificates additional certificates to proceed to the verification. | |
87 | * @return the result of that verification, and information contained in the signed data. | |
88 | * @throws java.security.GeneralSecurityException on error. | |
89 | */ | |
90 | CMSSignedDataVerified verify(byte[] signature, byte[] data, Collection<CertifiedPublicKey> certificates) | |
91 | throws GeneralSecurityException; | |
92 | ||
93 | /** | |
94 | * Verify all signature contained in the signature against the provided data. | |
95 | * | |
96 | * @param signature the encoded signature to verify. | |
97 | * @param data the data to check the signature against. | |
98 | * @param certificateProvider provider of additional certificate to proceed to the verification. | |
99 | * @return the result of that verification, and information contained in the signed data. | |
100 | * @throws java.security.GeneralSecurityException on error. | |
101 | */ | |
102 | CMSSignedDataVerified verify(byte[] signature, byte[] data, CertificateProvider certificateProvider) | |
103 | throws GeneralSecurityException; | |
104 | } |