2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FSecIPublicKey.h
19 * @brief This is the header file for the %IPublicKey interface.
21 * This header file contains the declarations of the %IPublicKey interface.
23 #ifndef _FSEC_IPUBLIC_KEY_H_
24 #define _FSEC_IPUBLIC_KEY_H_
29 namespace Tizen { namespace Security
33 * @interface IPublicKey
34 * @brief This interface provides the functionality shared by all the public key instances.
38 * The %IPublicKey interface provides the functionality shared by all the public key instances. @n
40 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/security/key_mgmt_and_csprng.htm">Key Management and CSPRNG</a>.
43 class _OSP_EXPORT_ IPublicKey
49 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes @n
50 * are called when the destructor of this interface is called.
54 virtual ~IPublicKey(void){}
57 * Gets the name of the primary encoding format of a key.
61 * @return The primary encoding format of a key
63 virtual Tizen::Base::String GetFormat(void) const = 0;
66 * Gets a public key in its primary encoding format.
70 * @return A pointer to the Tizen::Base::ByteBuffer class that contains the output, @n
71 * else @c null if an error occurs
72 * @exception E_SUCCESS The method is successful.
73 * @exception E_OUT_OF_MEMORY The memory is insufficient.
74 * @remarks The specific error code can be accessed using the GetLastResult() method.
76 virtual Tizen::Base::ByteBuffer* GetEncodedN(void) const = 0;
79 * Sets the public key buffer.
83 * @return An error code
84 * @param[in] keyBuffer An instance of Tizen::Base::ByteBuffer
85 * @exception E_SUCCESS The method is successful.
86 * @exception E_INVALID_ARG The specified @c keyBuffer is invalid.
88 virtual result SetKey(const Tizen::Base::ByteBuffer& keyBuffer) = 0;
92 // This method is for internal use only. Using this method can cause behavioral, security-related,
93 // and consistency-related issues in the application.
95 // This method is reserved and may change its name at any time without prior notice.
99 virtual void IPublicKey_Reserved1(void) {}
103 } } //Tizen::Security
105 #endif //_FSEC_IPUBLIC_KEY_H_