Top Description Fields Constructors Methods
net.fortuna.ical4j.util

public Class RandomUidGenerator

extends Object
implements UidGenerator
Class Inheritance
All Implemented Interfaces
net.fortuna.ical4j.util.UidGenerator, java.util.function.Supplier
Imports
net.fortuna.ical4j.model.property.Uid, java.security.SecureRandom, java.util.Base64, .UUID

This UidGenerator uses the Java UUID#randomUUID() implementation to generate UIDs. For ultimate security you can also use the secure flag to generate UIDs that are less crackable (from Moving away from UUIDs). Extract from RFC7986:
The description of the "UID" property in [RFC5545] contains some
recommendations on how the value can be constructed.  In particular,
it suggests use of host names, IP addresses, and domain names to
construct the value.  However, this is no longer considered good
practice, particularly from a security and privacy standpoint, since
use of such values can leak key information about a calendar user or
their client and network environment.  This specification updates
[RFC5545] by stating that "UID" values MUST NOT include any data that
might identify a user, host, domain, or any other security- or
privacy-sensitive information.  It is RECOMMENDED that calendar user
agents now generate "UID" values that are hex-encoded random
Universally Unique Identifier (UUID) values as defined in
Sections 4.4 and 4.5 of [RFC4122].

The following is an example of such a property value:

UID:5FC53010-1267-4F8E-BC28-1D7AE55A7C99

Field Summary

Modifier and TypeField and Description
private final Base64.Encoder
private final SecureRandom
private final boolean

Constructor Summary

AccessConstructor and Description
public
public
RandomUidGenerator(boolean secure)

Method Summary

Modifier and TypeMethod and Description
public Uid
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encoderback to summary
private final Base64.Encoder encoder
randomback to summary
private final SecureRandom random
secureback to summary
private final boolean secure

Constructor Detail

RandomUidGeneratorback to summary
public RandomUidGenerator()
RandomUidGeneratorback to summary
public RandomUidGenerator(boolean secure)

Method Detail

generateUidback to summary
public Uid generateUid()

Implements net.fortuna.ical4j.util.UidGenerator.generateUid.

Returns:Uid

Doc from net.fortuna.ical4j.util.UidGenerator.generateUid.

a unique component identifier

Annotations
@Override
isSecureback to summary
public boolean isSecure()