blob: 85bc6101eb68d8a8ca4524e54e13baac5c4eb3ab [file] [log] [blame]
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
*/
/*
* Internal M-Pin Crypto interface
*/
#ifndef _MPIN_CRYPTO_H_
#define _MPIN_CRYPTO_H_
#include <string>
#include <vector>
#include "mpin_sdk.h"
class IMPinCrypto
{
public:
typedef MPinSDK::String String;
typedef MPinSDK::Status Status;
typedef MPinSDK::UserPtr UserPtr;
virtual ~IMPinCrypto() {}
virtual Status OpenSession() = 0;
virtual void CloseSession() = 0;
virtual Status Register(IN UserPtr user, const String& pin, IN std::vector<String>& clientSecretShares) = 0;
virtual Status AuthenticatePass1(IN UserPtr user, const String& pin, int date, IN std::vector<String>& timePermitShares, OUT String& commitmentU, OUT String& commitmentUT) = 0;
virtual Status AuthenticatePass2(IN UserPtr user, const String& challenge, OUT String& validator) = 0;
virtual void DeleteToken(const String& mpinId) = 0;
virtual Status SaveRegOTT(const String& mpinId, const String& regOTT) = 0;
virtual Status LoadRegOTT(const String& mpinId, OUT String& regOTT) = 0;
virtual Status DeleteRegOTT(const String& mpinId) = 0;
};
#endif // _MPIN_CRYPTO_H_