NewDCESecurity returns a DCE Security (Version 2) UUID. The domain should be one of Person, Group or Org. On a POSIX system the id should be the users UID for the Person domain and the users GID for the Group. The meaning of id for the domain Org or on non-POSIX systems is site defined. For a giv
(domain Domain, id uint32)
| 30 | // For a given domain/id pair the same token may be returned for up to |
| 31 | // 7 minutes and 10 seconds. |
| 32 | func NewDCESecurity(domain Domain, id uint32) (UUID, error) { |
| 33 | uuid, err := NewUUID() |
| 34 | if err == nil { |
| 35 | uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2 |
| 36 | uuid[9] = byte(domain) |
| 37 | binary.BigEndian.PutUint32(uuid[0:], id) |
| 38 | } |
| 39 | return uuid, err |
| 40 | } |
| 41 | |
| 42 | // NewDCEPerson returns a DCE Security (Version 2) UUID in the person |
| 43 | // domain with the id returned by os.Getuid. |