Class PushCredentialsFile
PUSH-CREDENTIALS.md section 3: UTF-8, unix-style ini, a byte-order mark ignored, LF or CRLF, # or ; comments, case-insensitive section names, the sections [users], [groups], [members] and [server], each optional and each at most once.[server] (section 3.6, ruled 2026-09-26) is the PN configuration of application ID *: the members VPubKey, VPrivKey, VSubject, fcmProject, fcmServiceAccountFile and, since PUSH-KEYFILES-DESIGN.md (K-7), VPrivKeyFile, named as PushProps names them, matched in any case; an unknown name is a WARNING naming the line and is ignored (S-1); an empty value is an absent member; the VAPID pair is both keys or neither, each valid and the two belonging together, else SEVERE and the pair is ignored (S-2) - unless VPrivKeyFile names the pair's file, when an inline VPrivKey is a WARNING and ignored. The paths in fcmServiceAccountFile and VPrivKeyFile are kept as written; the loader resolves and reads them.
Pure. No I/O and no logging: parse(byte[],String) answers a PushCredentialsFile.Parsed that carries the valid entries and a PushCredentialsFile.Diagnostic per refusal or warning, which the loader logs. A diagnostic names the file and the line number and never a line's content, a password or a hash (section 8): a duplicate user, a user in no group and a member line without a user name the user ID, because the operator needs it to act.
What is refused, and how (sections 3.1 to 3.3): a user line that is not userID TAB type TAB password, a user ID with whitespace or a colon, a password type that is not IZ1, sha512, sha256 or plain - the weaker ones (md5, sha1, sha224, crypt, des, ntlm) are refused by name - a plain password ending in a space or TAB, a hash of the wrong shape, a duplicate user ID (both lines), a group with an unknown privilege (the group grants nothing), a line outside any section, an unknown section and a section that appears twice. Every refusal is SEVERE and the line is ignored; the valid lines still apply.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA refusal or a warning of the parser: theILoglevel, the line (0 for a whole-file message) and the message, which never carries a line's content.static final classThe result of a parse: the valid entries and the diagnostics.static enumThe password storage types of section 3.2.static final recordA user of the[users]section.Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe section names.static final StringThe section names.static final StringThe section names.static final StringThe section names.static final StringThe[server]member naming the PATH of the Firebase service-account key file: "fcmServiceAccountFile", the name.iiziPushuses too (PushProps.FCM_SERVICE_ACCOUNT_FILE).static final StringThe[server]member naming the PATH of the VAPID key file: "VPrivKeyFile", the name.iiziPushuses too (PushProps.VAPID_PRIVATE_KEY_FILE); ruling K-7 ofPUSH-KEYFILES-DESIGN.md.Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidUserID(String userID) Validates a user ID by section 3.1: at least one character, no whitespace of any kind, no colon.static PushCredentialsFile.ParsedParses the bytes of a file: UTF-8, a byte-order mark ignored.static PushCredentialsFile.ParsedParses the text of a file.
Field Details
SECTION_USERS
SECTION_GROUPS
SECTION_MEMBERS
SECTION_SERVER
SERVER_FCM_SERVICE_ACCOUNT_FILE
The[server]member naming the PATH of the Firebase service-account key file: "fcmServiceAccountFile", the name.iiziPushuses too (PushProps.FCM_SERVICE_ACCOUNT_FILE). The other members arePushProps.VAPID_PUBLIC_KEY,PushProps.VAPID_PRIVATE_KEY,PushProps.VAPID_SUBJECT,PushProps.FCM_PROJECT_IDandSERVER_VAPID_PRIVATE_KEY_FILE.- See Also:
SERVER_VAPID_PRIVATE_KEY_FILE
The[server]member naming the PATH of the VAPID key file: "VPrivKeyFile", the name.iiziPushuses too (PushProps.VAPID_PRIVATE_KEY_FILE); ruling K-7 ofPUSH-KEYFILES-DESIGN.md. A relative path is under the key directory (K-8).- See Also:
Method Details
parse
Parses the bytes of a file: UTF-8, a byte-order mark ignored.- Parameters:
bytes- The file content.fileName- The file name, for the diagnostics.- Returns:
- The result, never null.
parse
Parses the text of a file.- Parameters:
text- The file content, LF or CRLF line endings.fileName- The file name, for the diagnostics.- Returns:
- The result, never null.
isValidUserID
Validates a user ID by section 3.1: at least one character, no whitespace of any kind, no colon.- Parameters:
userID- The user ID, may be null.- Returns:
- true when valid.