xref: /illumos-gate/usr/src/lib/gss_mechs/mech_krb5/krb5/krb/get_set_keyblock.c (revision 10db1377dafab8ba3feedef26db9c5d8539a5cd1)
1*10db1377Sgtb /*
2*10db1377Sgtb  * CDDL HEADER START
3*10db1377Sgtb  *
4*10db1377Sgtb  * The contents of this file are subject to the terms of the
5*10db1377Sgtb  * Common Development and Distribution License (the "License").
6*10db1377Sgtb  * You may not use this file except in compliance with the License.
7*10db1377Sgtb  *
8*10db1377Sgtb  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*10db1377Sgtb  * or http://www.opensolaris.org/os/licensing.
10*10db1377Sgtb  * See the License for the specific language governing permissions
11*10db1377Sgtb  * and limitations under the License.
12*10db1377Sgtb  *
13*10db1377Sgtb  * When distributing Covered Code, include this CDDL HEADER in each
14*10db1377Sgtb  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*10db1377Sgtb  * If applicable, add the following below this CDDL HEADER, with the
16*10db1377Sgtb  * fields enclosed by brackets "[]" replaced with your own identifying
17*10db1377Sgtb  * information: Portions Copyright [yyyy] [name of copyright owner]
18*10db1377Sgtb  *
19*10db1377Sgtb  * CDDL HEADER END
20*10db1377Sgtb  */
21*10db1377Sgtb 
22*10db1377Sgtb /*
23*10db1377Sgtb  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*10db1377Sgtb  * Use is subject to license terms.
25*10db1377Sgtb  */
26*10db1377Sgtb 
27*10db1377Sgtb #pragma ident	"%Z%%M%	%I%	%E% SMI"
28*10db1377Sgtb 
29*10db1377Sgtb #include "k5-int.h"
30*10db1377Sgtb 
31*10db1377Sgtb 
32*10db1377Sgtb krb5_enctype
33*10db1377Sgtb krb5_get_key_enctype(krb5_keyblock *kb)
34*10db1377Sgtb {
35*10db1377Sgtb 	return (kb->enctype);
36*10db1377Sgtb }
37*10db1377Sgtb 
38*10db1377Sgtb unsigned int
39*10db1377Sgtb krb5_get_key_length(krb5_keyblock *kb)
40*10db1377Sgtb {
41*10db1377Sgtb 	return (kb->length);
42*10db1377Sgtb }
43*10db1377Sgtb 
44*10db1377Sgtb krb5_octet *
45*10db1377Sgtb krb5_get_key_data(krb5_keyblock *kb)
46*10db1377Sgtb {
47*10db1377Sgtb 	return (kb->contents);
48*10db1377Sgtb }
49*10db1377Sgtb 
50*10db1377Sgtb void
51*10db1377Sgtb krb5_set_key_enctype(krb5_keyblock *kb, krb5_enctype enctype)
52*10db1377Sgtb {
53*10db1377Sgtb 	kb->enctype = enctype;
54*10db1377Sgtb }
55*10db1377Sgtb 
56*10db1377Sgtb void
57*10db1377Sgtb krb5_set_key_length(krb5_keyblock *kb, unsigned int len)
58*10db1377Sgtb {
59*10db1377Sgtb 	kb->length = len;
60*10db1377Sgtb }
61*10db1377Sgtb 
62*10db1377Sgtb void
63*10db1377Sgtb krb5_set_key_data(krb5_keyblock *kb, krb5_octet *data)
64*10db1377Sgtb {
65*10db1377Sgtb 	kb->contents = data;
66*10db1377Sgtb }
67