View Javadoc
1   /*
2    * GordianKnot: Security Suite
3    * Copyright 2012-2026. Tony Washer
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6    * use this file except in compliance with the License.  You may obtain a copy
7    * of the License at
8    *
9    *   http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
14   * License for the specific language governing permissions and limitations under
15   * the License.
16   */
17  package io.github.tonywasher.joceanus.gordianknot.api.agree;
18  
19  import io.github.tonywasher.joceanus.gordianknot.api.base.GordianException;
20  import io.github.tonywasher.joceanus.gordianknot.api.cert.GordianCertificate;
21  import io.github.tonywasher.joceanus.gordianknot.api.sign.GordianSignatureSpec;
22  
23  /**
24   * Key Agreement Parameters Specification.
25   */
26  public interface GordianAgreementParams {
27      /**
28       * Obtain the agreementSpec.
29       *
30       * @return the spec
31       */
32      GordianAgreementSpec getAgreementSpec();
33  
34      /**
35       * Obtain the resultType.
36       *
37       * @return the resultType
38       */
39      Object getResultType();
40  
41      /**
42       * Obtain the clientCertificate.
43       *
44       * @return the certificate
45       */
46      GordianCertificate getClientCertificate();
47  
48      /**
49       * Obtain the serverCertificate.
50       *
51       * @return the certificate
52       */
53      GordianCertificate getServerCertificate();
54  
55      /**
56       * Obtain the signerCertificate.
57       *
58       * @return the certificate
59       */
60      GordianCertificate getSignerCertificate();
61  
62      /**
63       * Obtain the signatureSpec.
64       *
65       * @return the signatureSpec
66       */
67      GordianSignatureSpec getSignatureSpec();
68  
69      /**
70       * Obtain the additionalData.
71       *
72       * @return the additional data
73       */
74      byte[] getAdditionalData();
75  
76      /**
77       * Set client Certificate.
78       *
79       * @param pClient the client certificate
80       * @return the new agreementParams
81       * @throws GordianException on error
82       */
83      GordianAgreementParams setClientCertificate(GordianCertificate pClient) throws GordianException;
84  
85      /**
86       * Set server Certificate.
87       *
88       * @param pServer the server certificate
89       * @return the new agreementParams
90       * @throws GordianException on error
91       */
92      GordianAgreementParams setServerCertificate(GordianCertificate pServer) throws GordianException;
93  
94      /**
95       * Declare signer certificate.
96       *
97       * @param pSigner the certificate
98       * @return the new agreementParams
99       * @throws GordianException on error
100      */
101     GordianAgreementParams setSigner(GordianCertificate pSigner) throws GordianException;
102 
103     /**
104      * Declare signer certificate and specification.
105      *
106      * @param pSigner   the certificate
107      * @param pSignSpec the signSpec
108      * @return the new agreementParams
109      * @throws GordianException on error
110      */
111     GordianAgreementParams setSigner(GordianCertificate pSigner,
112                                      GordianSignatureSpec pSignSpec) throws GordianException;
113 
114     /**
115      * Set additional data.
116      *
117      * @param pData the additional data
118      * @return the new agreementParams
119      * @throws GordianException on error
120      */
121     GordianAgreementParams setAdditionalData(byte[] pData) throws GordianException;
122 }