1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
25 #define _UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX
26 
27 #include <rtl/ref.hxx>
28 #include <ucbhelper/interactionrequest.hxx>
29 #include "ucbhelper/ucbhelperdllapi.h"
30 #include <com/sun/star/security/XCertificate.hpp>
31 
32 
33 namespace ucbhelper {
34 
35 /**
36   * This class implements a simple validation interaction request of a certificate.
37   * Instances can be passed directly to XInteractionHandler::handle(...). Each
38   * instance contains an CertificateValidationRequest and two interaction
39   * continuations: "Abort" and "Approved". The parameters
40   * for the CertificateValidationRequest object are partly taken from contructors parameters and partly defaulted
41   * as follows:
42   *
43   * Read-write values: certificateValidity, certificate
44   *
45   * @see com::sun::star::ucb::CertificateValidationRequest
46   * @see InteractionApproved
47   * @see InteractionRetry
48   */
49 class UCBHELPER_DLLPUBLIC SimpleCertificateValidationRequest : public ucbhelper::InteractionRequest
50 {
51 public:
52     /**
53       * Constructor.
54       *
55       * @param lCertificateValidity contains a bitmask which validation error occur.
56       * @param pCertificate contaisn the server certificate.
57 	  */
58     SimpleCertificateValidationRequest( const sal_Int32 & lCertificateValidity,
59 		const com::sun::star::uno::Reference<com::sun::star::security::XCertificate> pCertificate,
60 		const rtl::OUString & hostname );
61 
62 	/**
63       * After passing this request to XInteractionHandler::handle, this method
64       * returns the continuation that was chosen by the interaction handler.
65 	  *
66       * @return the continuation chosen by an interaction handler or
67       *         CONTINUATION_UNKNOWN, if the request was not (yet) handled.
68 	  */
69     sal_Int32 getResponse() const;
70 };
71 
72 } // namespace ucbhelper
73 
74 #endif /* !_UCBHELPER_SIMPLECERTIFICATEVALIDATIONREQUEST_HXX */
75