1*d1766043SAndrew Rist/**************************************************************
2*d1766043SAndrew Rist *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir#ifndef __com_sun_star_xml_crypto_xsecurityenvironment_idl_
25cdf0e10cSrcweir#define __com_sun_star_xml_crypto_xsecurityenvironment_idl_
26cdf0e10cSrcweir
27cdf0e10cSrcweir#ifndef __com_sun_star_uno_SecurityException_idl__
28cdf0e10cSrcweir#include <com/sun/star/uno/SecurityException.idl>
29cdf0e10cSrcweir#endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
32cdf0e10cSrcweir#include <com/sun/star/uno/Exception.idl>
33cdf0e10cSrcweir#include <com/sun/star/security/XCertificate.idl>
34cdf0e10cSrcweir#include <com/sun/star/security/CertificateCharacters.idl>
35cdf0e10cSrcweir#include <com/sun/star/security/CertificateValidity.idl>
36cdf0e10cSrcweir
37cdf0e10cSrcweirmodule com { module sun { module star { module xml { module crypto {
38cdf0e10cSrcweir
39cdf0e10cSrcweir/**
40cdf0e10cSrcweir * Interface of Security Environment
41cdf0e10cSrcweir */
42cdf0e10cSrcweirpublished interface XSecurityEnvironment : com::sun::star::uno::XInterface
43cdf0e10cSrcweir{
44cdf0e10cSrcweir    /**
45cdf0e10cSrcweir     * Get personal certificate from the environment
46cdf0e10cSrcweir     */
47cdf0e10cSrcweir    sequence< com::sun::star::security::XCertificate > getPersonalCertificates() raises( com::sun::star::uno::SecurityException ) ;
48cdf0e10cSrcweir
49cdf0e10cSrcweir    /**
50cdf0e10cSrcweir     * Get certificate from the environment by issuer name and serial number
51cdf0e10cSrcweir     */
52cdf0e10cSrcweir    com::sun::star::security::XCertificate getCertificate( [in] string issuerName, [in] sequence< byte > serialNumber ) raises( com::sun::star::uno::SecurityException ) ;
53cdf0e10cSrcweir
54cdf0e10cSrcweir    /**
55cdf0e10cSrcweir     * build certificate path from a certain certificate
56cdf0e10cSrcweir     */
57cdf0e10cSrcweir    sequence< com::sun::star::security::XCertificate > buildCertificatePath( [in] com::sun::star::security::XCertificate beginCert ) raises( com::sun::star::uno::SecurityException ) ;
58cdf0e10cSrcweir
59cdf0e10cSrcweir    /**
60cdf0e10cSrcweir     * Create certificate interface from raw DER encoded certificate
61cdf0e10cSrcweir     */
62cdf0e10cSrcweir    com::sun::star::security::XCertificate createCertificateFromRaw( [in] sequence< byte > rawCertificate ) raises( com::sun::star::uno::SecurityException ) ;
63cdf0e10cSrcweir
64cdf0e10cSrcweir    /**
65cdf0e10cSrcweir     * Create certificate interface from a BASE64 encoded certificate.
66cdf0e10cSrcweir     */
67cdf0e10cSrcweir    com::sun::star::security::XCertificate createCertificateFromAscii( [in] string asciiCertificate ) raises( com::sun::star::uno::SecurityException ) ;
68cdf0e10cSrcweir
69cdf0e10cSrcweir    /**
70cdf0e10cSrcweir      Verify a certificate.
71cdf0e10cSrcweir
72cdf0e10cSrcweir      The method provides a way to verify a certificate.
73cdf0e10cSrcweir      @param xEECertificate
74cdf0e10cSrcweir          The certificate which is to be validated.
75cdf0e10cSrcweir
76cdf0e10cSrcweir      @param intermediateCertificates
77cdf0e10cSrcweir          Additional certificates which can be used by the method in constructing
78cdf0e10cSrcweir          the certificate chain. The root certificate may also be contained. However,
79cdf0e10cSrcweir          the implementation must check if the root certificate is indeed trusted by
80cdf0e10cSrcweir          the user.
81cdf0e10cSrcweir          All entries of the sequence must be non-null references.
82cdf0e10cSrcweir
83cdf0e10cSrcweir      @return
84cdf0e10cSrcweir          The validation status will returned as a bit-wise long, please refer to
85cdf0e10cSrcweir          CertificateValidity definition.
86cdf0e10cSrcweir     */
87cdf0e10cSrcweir    long verifyCertificate( [in] com::sun::star::security::XCertificate xEECertificate,
88cdf0e10cSrcweir        [in] sequence< com::sun::star::security::XCertificate > intermediateCertificates)
89cdf0e10cSrcweir        raises( com::sun::star::uno::SecurityException ) ;
90cdf0e10cSrcweir
91cdf0e10cSrcweir    /**
92cdf0e10cSrcweir     * Get a certificate characters.
93cdf0e10cSrcweir     *
94cdf0e10cSrcweir     * The method provides a way to get certificate characters like:
95cdf0e10cSrcweir     * 1. Whether or not the certificate have a private key in the user profile.
96cdf0e10cSrcweir     * 2. Whether or not the certificate is a trusted certificate.
97cdf0e10cSrcweir     * 3. Whether or not the certificate is a self-signed certificate.
98cdf0e10cSrcweir     *
99cdf0e10cSrcweir     * The certificate characters is defined as bit-wise long, please refer to
100cdf0e10cSrcweir     * CertificateCharacters definition.
101cdf0e10cSrcweir     */
102cdf0e10cSrcweir    long getCertificateCharacters( [in] com::sun::star::security::XCertificate xCertificate ) raises( com::sun::star::uno::SecurityException ) ;
103cdf0e10cSrcweir
104cdf0e10cSrcweir    /**
105cdf0e10cSrcweir     * Get the Environment detail infos
106cdf0e10cSrcweir     */
107cdf0e10cSrcweir    string getSecurityEnvironmentInformation ( );
108cdf0e10cSrcweir
109cdf0e10cSrcweir} ;
110cdf0e10cSrcweir
111cdf0e10cSrcweir} ; } ; } ; } ; } ;
112cdf0e10cSrcweir
113cdf0e10cSrcweir#endif
114cdf0e10cSrcweir
115