Sergey Pastor / 1

Dependents:   Nucleo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers oid.h Source File

oid.h

Go to the documentation of this file.
00001 /**
00002  * @file oid.h
00003  * @brief OID (Object Identifier)
00004  *
00005  * @section License
00006  *
00007  * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
00008  *
00009  * This file is part of CycloneCrypto Open.
00010  *
00011  * This program is free software; you can redistribute it and/or
00012  * modify it under the terms of the GNU General Public License
00013  * as published by the Free Software Foundation; either version 2
00014  * of the License, or (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00024  *
00025  * @author Oryx Embedded SARL (www.oryx-embedded.com)
00026  * @version 1.7.6
00027  **/
00028 
00029 #ifndef _OID_H
00030 #define _OID_H
00031 
00032 //Dependencies
00033 #include "crypto.h"
00034 
00035 //Mask definition
00036 #define OID_MORE_FLAG  0x80
00037 #define OID_VALUE_MASK 0x7F
00038 
00039 //OID related functions
00040 error_t oidCheck(const uint8_t *oid, size_t oidLen);
00041 
00042 int_t oidComp(const uint8_t *oid1, size_t oidLen1,
00043    const uint8_t *oid2, size_t oidLen2);
00044 
00045 error_t oidEncodeSubIdentifier(uint8_t *oid,
00046    size_t maxOidLen, size_t *pos, uint32_t value);
00047 
00048 error_t oidDecodeSubIdentifier(const uint8_t *oid,
00049    size_t oidLen, size_t *pos, uint32_t *value);
00050 
00051 error_t oidFromString(const char_t *str,
00052    uint8_t *oid, size_t maxOidLen, size_t *oidLen);
00053 
00054 char_t *oidToString(const uint8_t *oid,
00055    size_t oidLen, char_t *str, size_t maxStrLen);
00056 
00057 #endif
00058