Builder
Object Hierarchy:
Description:
[ CCode ( copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "gck_builder_get_type ()" ) ]
[ Compact ]
public class Builder
[ Compact ]
public class Builder
A builder for a set of attributes.
Add attributes to a builder, and then use [methodBuilder.end
] to get the completed [structAttributes
].
The fields of Builder are private and not to be accessed directly.
Namespace: Gck
Package: gck-1
Content:
Static methods:
- public static void unref (void* builder)
Creation methods:
- public Builder (BuilderFlags flags)
Create a new `GckBuilder` not allocated on the stack, so it can be shared across a single scope, and referenced / unreferenced.
Methods:
- public Builder @ref ()
Add a reference to a builder that was created with [ctor
Builder.new
]. - public void add_all (Attributes attrs)
Add all the
attrs
attributes to the builder. - public void add_attribute (Attribute attr)
Add an attribute to the builder.
- public void add_boolean (ulong attr_type, bool value)
Add a new attribute to the builder for the boolean
value
. - public void add_data (ulong attr_type, uint8[]? value)
Add a new attribute to the builder with an arbitrary value.
- public void add_date (ulong attr_type, Date value)
Add a new attribute to the builder for the date
value
. - public void add_empty (ulong attr_type)
Add a new attribute to the builder that is empty.
- public void add_invalid (ulong attr_type)
Add a new attribute to the builder that is invalid in the PKCS#11 sense.
- public void add_onlyv (Attributes attrs, ulong[] only_types)
Add the attributes with the types in
only_types
fromattrs
to the builder. - public void add_string (ulong attr_type, string? value)
Add a new attribute to the builder for the string
value
ornull
. - public void add_ulong (ulong attr_type, ulong value)
Add a new attribute to the builder for the unsigned long
value
. - public void clear ()
Clear the builder and release all allocated memory.
- public Builder copy ()
Make a copy of the builder and its state.
- public unowned Attributes end ()
Complete the Builder, and return the attributes contained in the builder.
- public unowned Attribute find (ulong attr_type)
Find an attribute in the builder.
- public bool find_boolean (ulong attr_type, out bool value)
Find a boolean attribute in the builder that has the type
attr_type
, is of the correct boolean size, and is not invalid in the PKCS#11 sense. - public bool find_date (ulong attr_type, out Date value)
Find a date attribute in the builder that has the type
attr_type
, is of the correct date size, and is not invalid in the PKCS#11 sense. - public bool find_string (ulong attr_type, out string value)
Find a string attribute in the builder that has the type
attr_type
, has a nonnull
value pointer, and is not invalid in the PKCS#11 sense. - public bool find_ulong (ulong attr_type, out ulong value)
Find a unsigned long attribute in the builder that has the type
attr_type
, is of the correct unsigned long size, and is not invalid in the PKCS#11 sense. - public void init ()
Initialize a stack allocated builder, with the default flags.
- public void init_full (BuilderFlags flags)
Initialize a stack allocated builder, with the appropriate flags.
- public void set_all (Attributes attrs)
Set all the
attrs
attributes to the builder. - public void set_boolean (ulong attr_type, bool value)
Set an attribute on the builder for the boolean
value
. - public void set_data (ulong attr_type, uint8[]? value)
Set a new attribute to the builder with an arbitrary value.
- public void set_date (ulong attr_type, Date value)
Set an attribute on the builder for the date
value
. - public void set_empty (ulong attr_type)
Set an attribute on the builder that is empty.
- public void set_invalid (ulong attr_type)
Set an attribute on the builder that is invalid in the PKCS#11 sense.
- public void set_string (ulong attr_type, string value)
Set an attribute on the builder for the string
value
ornull
. - public void set_ulong (ulong attr_type, ulong value)
Set an attribute on the builder for the unsigned long
value
. - public Attributes steal ()
Take the attributes that have been built in the Builder .
- public void take_data (ulong attr_type, owned uint8[]? value)
Add a new attribute to the builder with an arbitrary value.