kirsapub.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/* Copyright (C) RSA Data Security, Inc. created 1990, 1996. This is an
unpublished work protected as such under copyright law. This work
contains proprietary, confidential, and trade secret information of
RSA Data Security, Inc. Use, disclosure or reproduction without the
express written authorization of RSA Data Security, Inc. is
prohibited.
*/
#include "port_before.h"
#include "global.h"
#include "bsafe2.h"
#include "bkey.h"
#include "kinfotyp.h"
#include "intitem.h"
#include "kifulprv.h"
#include "kirsapub.h"
#include "port_after.h"
static A_RSA_KEY STATIC_RSA_KEY;
static ITEM *RSA_KEY_ITEMS[] =
int KI_RSAPublic (keyInfoType)
{
/* Return 1 to indicate a KeyInfoType, not an AlgorithmInfoType */
return (1);
}
{
int status;
/* Allocate memory for A_RSA_KEY struct and copy integers
from supplied value.
*/
if ((status = B_MemoryPoolAlloc
return (status);
if ((status = AllocAndCopyIntegerItems
sizeof (RSA_KEY_ITEMS) / sizeof (RSA_KEY_ITEMS[0]),
return (status);
return (B_InfoCacheAddInfo
}
{
int status;
/* If not already found in the cache, try to get values from
a full private key info, setting unneeded entries to NULL.
*/
if ((status = GetFullPrivateKeyInfo
return (status);
/* Got all the needed fields, so allocate memory for a new
A_RSA_KEY struct and copy the key value.
*/
if ((status = B_MemoryPoolAlloc
return (status);
return (0);
}