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 __com_sun_star_xml_crypto_xsecurityenvironment_idl_ 25#define __com_sun_star_xml_crypto_xsecurityenvironment_idl_ 26 27#ifndef __com_sun_star_uno_SecurityException_idl__ 28#include <com/sun/star/uno/SecurityException.idl> 29#endif 30 31#include <com/sun/star/uno/XInterface.idl> 32#include <com/sun/star/uno/Exception.idl> 33#include <com/sun/star/security/XCertificate.idl> 34#include <com/sun/star/security/CertificateCharacters.idl> 35#include <com/sun/star/security/CertificateValidity.idl> 36 37module com { module sun { module star { module xml { module crypto { 38 39/** 40 * Interface of Security Environment 41 */ 42published interface XSecurityEnvironment : com::sun::star::uno::XInterface 43{ 44 /** 45 * Get personal certificate from the environment 46 */ 47 sequence< com::sun::star::security::XCertificate > getPersonalCertificates() raises( com::sun::star::uno::SecurityException ) ; 48 49 /** 50 * Get certificate from the environment by issuer name and serial number 51 */ 52 com::sun::star::security::XCertificate getCertificate( [in] string issuerName, [in] sequence< byte > serialNumber ) raises( com::sun::star::uno::SecurityException ) ; 53 54 /** 55 * build certificate path from a certain certificate 56 */ 57 sequence< com::sun::star::security::XCertificate > buildCertificatePath( [in] com::sun::star::security::XCertificate beginCert ) raises( com::sun::star::uno::SecurityException ) ; 58 59 /** 60 * Create certificate interface from raw DER encoded certificate 61 */ 62 com::sun::star::security::XCertificate createCertificateFromRaw( [in] sequence< byte > rawCertificate ) raises( com::sun::star::uno::SecurityException ) ; 63 64 /** 65 * Create certificate interface from a BASE64 encoded certificate. 66 */ 67 com::sun::star::security::XCertificate createCertificateFromAscii( [in] string asciiCertificate ) raises( com::sun::star::uno::SecurityException ) ; 68 69 /** 70 Verify a certificate. 71 72 The method provides a way to verify a certificate. 73 @param xEECertificate 74 The certificate which is to be validated. 75 76 @param intermediateCertificates 77 Additional certificates which can be used by the method in constructing 78 the certificate chain. The root certificate may also be contained. However, 79 the implementation must check if the root certificate is indeed trusted by 80 the user. 81 All entries of the sequence must be non-null references. 82 83 @return 84 The validation status will returned as a bit-wise long, please refer to 85 CertificateValidity definition. 86 */ 87 long verifyCertificate( [in] com::sun::star::security::XCertificate xEECertificate, 88 [in] sequence< com::sun::star::security::XCertificate > intermediateCertificates) 89 raises( com::sun::star::uno::SecurityException ) ; 90 91 /** 92 * Get a certificate characters. 93 * 94 * The method provides a way to get certificate characters like: 95 * 1. Whether or not the certificate have a private key in the user profile. 96 * 2. Whether or not the certificate is a trusted certificate. 97 * 3. Whether or not the certificate is a self-signed certificate. 98 * 99 * The certificate characters is defined as bit-wise long, please refer to 100 * CertificateCharacters definition. 101 */ 102 long getCertificateCharacters( [in] com::sun::star::security::XCertificate xCertificate ) raises( com::sun::star::uno::SecurityException ) ; 103 104 /** 105 * Get the Environment detail infos 106 */ 107 string getSecurityEnvironmentInformation ( ); 108 109} ; 110 111} ; } ; } ; } ; } ; 112 113#endif 114 115