Discover Packages
github.com/adreed-msft/keyctl
package
module
Version:
v0.0.0-...-b8df48b
Opens a new window with list of versions in this module.
Published: May 28, 2019
License: BSD-3-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
keyctl
Slim version of github.com/jsipprell/keyctl
with basic keyring operations.
Expand ▾
Collapse ▴
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
A Go interface to linux kernel keyrings (keyctl interface)
Change group ownership on a key or keyring.
Change user ownership on a key or keyring.
Set permissions on a key or keyring.
Unlink an object from a keyring
type Id interface {
Id() int32
}
All Keys and Keyrings have unique 32-bit serial number identifiers.
type Key struct {
Name string
}
Key represents a single key linked to one or more kernel keyrings.
Get returns the key's value as a byte slice
Id returns the 32-bit kernel identifier for a specific key
Set the key's value from a bytes slice. Expiration, if active, is reset by calling this method.
Unlink a key from the keyring it was loaded from (or added to). If the key
is not linked to any other keyrings, it is destroyed.
KeyPerm represents in-kernel access control permission to keys and keyrings
as a 32-bit integer broken up into four permission sets, one per byte.
In MSB order, the perms are: Processor, User, Group, Other.
const (
PermOtherView KeyPerm = 1 << iota
PermOtherRead
PermOtherWrite
PermOtherSearch
PermOtherLink
PermOtherSetattr
)
const (
PermGroupView KeyPerm = 1 << (8 + iota )
PermGroupRead
PermGroupWrite
PermGroupSearch
PermGroupLink
PermGroupSetattr
)
const (
PermUserView KeyPerm = 1 << (16 + iota )
PermUserRead
PermUserWrite
PermUserSearch
PermUserLink
PermUserSetattr
)
const (
PermProcessView KeyPerm = 1 << (24 + iota )
PermProcessRead
PermProcessWrite
PermProcessSearch
PermProcessLink
PermProcessSetattr
)
const (
PermOtherAll KeyPerm = 0x3f << (8 * iota )
PermGroupAll
PermUserAll
PermProcessAll
)
Returns the group permissions in symbolic form
Returns other (default) permissions in symbolic form
Returns processor permissions in symbolic form
Returns the user permissions in symbolic form
Basic interface to a linux keyctl keyring.
Return the current login session keyring
Named keyrings are user-created keyrings linked to a parent keyring. The
parent can be either named or one of the in-built keyrings (session, group
etc). The in-built keyrings have no parents. Keyring searching is performed
hierarchically.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.