/* * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ using System; using static Interop; namespace Tizen.Security.SecureRepository { /// /// A class for a policy for storing key, certificate, and binary data. /// /// 3 public class Policy { /// /// A default constructor of Policy with default policy. /// /// 3 /// The default value for Password is null and the default value for Extractabl is false. public Policy() { Password = null; Extractable = true; } /// /// A constructor of Key that takes the password and the flag for extractable. /// /// 3 /// Used to encrypt data secure repository. /// If true key may be extracted from secure repository. public Policy(String password, bool extractable) { Password = password; Extractable = extractable; } /// /// Used to encrypt data secure repository. If it is not null, the data /// (or key, or certificate) is stored encrypted with this password inside secure repository /// /// 3 public String Password { get; set; } /// /// If true key may be extracted from secure repository. /// /// 3 public bool Extractable { get; set; } internal CkmcPolicy ToCkmcPolicy() { return new Interop.CkmcPolicy(Password, Extractable); } } }