delete.c revision 448b8615fe9e8af757530284920a235430ead7e8
088fa5d9eaa83bf4b3d59a64c0519f42a143aaa9Alin Brici * CDDL HEADER START
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * The contents of this file are subject to the terms of the
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Common Development and Distribution License (the "License").
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * You may not use this file except in compliance with the License.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * or http://www.opensolaris.org/os/licensing.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * See the License for the specific language governing permissions
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * and limitations under the License.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * When distributing Covered Code, include this CDDL HEADER in each
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * If applicable, add the following below this CDDL HEADER, with the
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * fields enclosed by brackets "[]" replaced with your own identifying
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * information: Portions Copyright [yyyy] [name of copyright owner]
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * CDDL HEADER END
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3f424ffdb194d6ff7ac053c5b3e53211a2de2d64Brendan Mmiller * Use is subject to license terms.
877835274f73615fe922911749e4de093fb26cceBrendan Mmiller#pragma ident "%Z%%M% %I% %E% SMI"
877835274f73615fe922911749e4de093fb26cceBrendan Mmiller * This file implements the token object delete operation for this tool.
877835274f73615fe922911749e4de093fb26cceBrendan Mmiller * It loads the PKCS#11 modules, finds the object to delete, deletes it,
877835274f73615fe922911749e4de093fb26cceBrendan Mmiller * and cleans up. User must be R/W logged into the token.
#include <string.h>
#include <cryptoutil.h>
#include "common.h"
#include <kmfapi.h>
static KMF_RETURN
int del_num = 0;
return (rv);
del_num++;
del_num++;
switch (kstype) {
case KMF_KEYSTORE_NSS:
sizeof (KMF_CREDENTIAL));
del_num++;
numattr);
del_num++;
case KMF_KEYSTORE_OPENSSL:
case KMF_KEYSTORE_PK11TOKEN:
sizeof (KMF_CREDENTIAL));
del_num++;
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
num++;
return (rv);
static KMF_RETURN
*keysdeleted = 0;
numkeys = 0;
num++;
B_FALSE)) {
return (KMF_OK);
sizeof (KMF_KEY_HANDLE));
return (KMF_ERR_MEMORY);
sizeof (KMF_KEY_HANDLE));
num++;
return (rv);
static KMF_RETURN
num++;
B_FALSE)) {
return (KMF_OK);
return (rv);
static KMF_RETURN
int numattr = 0;
return (rv);
numattr++;
numattr++;
numattr++;
numattr++;
num++;
num++;
num++;
return (rv);
static KMF_RETURN
int numattr = 0;
return (rv);
numattr++;
numattr++;
numattr++;
numattr++;
sizeof (KMF_BIGINT));
numattr++;
sizeof (KMF_CERT_VALIDITY));
numattr++;
numattr++;
return (rv);
static KMF_RETURN
int numattr = 0;
return (rv);
numattr++;
numattr++;
numattr++;
numattr++;
return (rv);
static KMF_RETURN
int numattr = 0;
return (rv);
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
num++;
num++;
num++;
return (rv);
static KMF_RETURN
int numattr = 0;
return (kmfrv);
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
return (kmfrv);
static KMF_RETURN
int numattr = 0;
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
numattr++;
return (rv);
static KMF_RETURN
int numattr = 0;
numattr++;
numattr++;
numattr++;
num++;
num++;
return (rv);
static KMF_RETURN
int numattr = 0;
return (KMF_ERR_BAD_PARAMETER);
numattr++;
if (filename) {
numattr++;
return (rv);
int opt;
extern int optind_av;
extern char *optarg_av;
int oclass = 0;
int rv = 0;
return (PK_ERR_USAGE);
switch (opt) {
if (token_spec)
return (PK_ERR_USAGE);
if (oclass)
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
if (object_label)
return (PK_ERR_USAGE);
if (kstype == 0)
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
if (kstype == 0)
return (PK_ERR_USAGE);
if (argc)
return (PK_ERR_USAGE);
return (PK_ERR_USAGE);
if (oclass == 0)
if (oclass == 0)
&tokencred);
return (kmfrv);
switch (kstype) {
case KMF_KEYSTORE_PK11TOKEN:
infile);
case KMF_KEYSTORE_NSS:
&tokencred);
(char *)object_label,
case KMF_KEYSTORE_OPENSSL:
infile);
return (kmfrv);